-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Question: "cannot use mapped file" #32
Comments
Frankly, I do not remember. Maybe you want to try and, if it works, open a PR? |
I just hit this too. I suspect the restriction is because of this: Lines 1573 to 1578 in 918ef6e
The proxy needs to know the size so that it can unmap it. The corresponding code in OCaml is https://github.com/ocaml/ocaml/blob/061adb721511a5d387e67c56abbfa57c34e9efe0/runtime/bigarray.c#L1083-L1090: proxy = malloc(sizeof(struct caml_ba_proxy));
if (proxy == NULL) caml_raise_out_of_memory();
caml_atomic_counter_init(&proxy->refcount, 2);
/* initial refcount: 2 = original array + sub array */
proxy->data = b1->data;
proxy->size =
b1->flags & CAML_BA_MAPPED_FILE ? caml_ba_byte_size(b1) : 0;
b1->proxy = proxy; Another possible reason is that file access might be slow, so possibly the runtime lock should be released during Cairo operations. But the file is likely to be an in-memory shm file anyway. And also, |
Hi,
I'm currently playing around with using
ocaml-cairo
as the renderer for a toy GUI project and callingof_data32
I get the error that a mapped file cannot be used.Why is this the case? Is it a fundamental limitation with the cairo library, or with the
Bigarray
representation or something else?The text was updated successfully, but these errors were encountered: