If a value is passed using Ctypes.string, then the OCaml string is copied into C-managed memory, and the copy is passed to C.
However, when passing a value using type Ctypes.(ptr string), I believe that no such copy happens, but I find the documentation a bit unclear on that point. If that is indeed the case, does this mean that types like ptr string or ptr (ptr string) are kind of not meaningful semantically?
If a value is passed using
Ctypes.string
, then the OCaml string is copied into C-managed memory, and the copy is passed to C.However, when passing a value using type
Ctypes.(ptr string)
, I believe that no such copy happens, but I find the documentation a bit unclear on that point. If that is indeed the case, does this mean that types likeptr string
orptr (ptr string)
are kind of not meaningful semantically?