Browse thread
Big array with data managed by another value
- Romain Beauxis
[
Home
]
[ Index:
by date
|
by threads
]
[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
| Date: | -- (:) |
| From: | Romain Beauxis <toots@r...> |
| Subject: | Big array with data managed by another value |
Hi all ! In our application, we use a custom block to carry a pointer to data allocated by C. We would like to use this data with functions that use Bigarrays. Hence, we want a [custom_to_bigarray] function that would allocate a big array, and put our pointer as its data. We can pass the CAML_BA_EXTERNAL flag to the bigarray, so that the Gc doesn't touch data pointer when deallocating the returned array. However, what I don't know how to do yet is to also tell the Gc that the original value should not be deallocated until we have finished dealing with the returned bigarray. Is there a clean way to do that ? Romain