Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allocating a bigarray from C #3997

Closed
vicuna opened this issue Apr 3, 2006 · 1 comment
Closed

Allocating a bigarray from C #3997

vicuna opened this issue Apr 3, 2006 · 1 comment

Comments

@vicuna
Copy link

vicuna commented Apr 3, 2006

Original bug ID: 3997
Reporter: sayan
Status: acknowledged (set by @damiendoligez on 2006-08-29T15:45:44Z)
Resolution: open
Priority: normal
Severity: feature
Version: 3.09.1
Category: otherlibs
Tags: patch
Monitored by: @whitequark @Chris00

Bug description

Please add the following comment to the bigarray documentation:
/* [alloc_bigarray] will allocate a new bigarray object in the heap.
If [data] is NULL, the memory for the contents is also allocated
(with [malloc]) by [alloc_bigarray].
[data] cannot point into the Caml heap.
[dim] may point into an object in the Caml heap.
*/

Additional information

This is a simple and GC-friendly way to allocate memory for a bigarray structure directly within C instead of calling Bigarray.genarray.create in Caml.

@xavierleroy
Copy link
Contributor

caml_ba_alloc is documented in the reference manual, section 20.10: https://caml.inria.fr/pub/docs/manual-ocaml/intfc.html#sec468 . I think that's enough documentation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants