You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Original bug ID: 4987 Reporter: goswin Status: acknowledged (set by @damiendoligez on 2011-06-01T12:32:22Z) Resolution: open Priority: normal Severity: feature Version: 3.11.2 Category: otherlibs Monitored by: tgazagna @hcarty@Chris00
Bug description
For libfuse-ocaml bindings I need to pass a buffer to a callback to ocaml. The complication is that, since the buffer is part of a larger request, it is in the middle of an allocated chunk of memory. Luckily ocaml can already handle this case nicely in the form of Bigarrays. In ocaml using "Bigarray.Array1.sub full_request offset length" I can create a subset of the full array without having to copy the data.
But this can not be used in C stubs as caml/bigarray.h does not export the API for proxy objects or the function to create sub arrays. For my use case it would be enough to add
CAMLprim value caml_ba_sub(value vb, value vofs, value vlen);
to caml/bigarray.h. But for completness the proxy struct should probably be exported as well as a helper function to savely free a bigarray (in case of Bigarrays not under GC control).
MfG
Goswin
The text was updated successfully, but these errors were encountered:
This issue has been open one year with no activity. Consequently, it is being marked with the "stale" label. What this means is that the issue will be automatically closed in 30 days unless more comments are added or the "stale" label is removed. Comments that provide new information on the issue are especially welcome: is it still reproducible? did it appear in other contexts? how critical is it? etc.
I think given that there hasn't been a ping on this issue for a decade, it's reasonable to close this. @mrvn (I assume this was from you) -- please submit a PR if this problem continues to cause trouble. Thanks.
Original bug ID: 4987
Reporter: goswin
Status: acknowledged (set by @damiendoligez on 2011-06-01T12:32:22Z)
Resolution: open
Priority: normal
Severity: feature
Version: 3.11.2
Category: otherlibs
Monitored by: tgazagna @hcarty @Chris00
Bug description
For libfuse-ocaml bindings I need to pass a buffer to a callback to ocaml. The complication is that, since the buffer is part of a larger request, it is in the middle of an allocated chunk of memory. Luckily ocaml can already handle this case nicely in the form of Bigarrays. In ocaml using "Bigarray.Array1.sub full_request offset length" I can create a subset of the full array without having to copy the data.
But this can not be used in C stubs as caml/bigarray.h does not export the API for proxy objects or the function to create sub arrays. For my use case it would be enough to add
CAMLprim value caml_ba_sub(value vb, value vofs, value vlen);
to caml/bigarray.h. But for completness the proxy struct should probably be exported as well as a helper function to savely free a bigarray (in case of Bigarrays not under GC control).
MfG
Goswin
The text was updated successfully, but these errors were encountered: