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

caml_alloc_abstract is missing and the abstract tag lightly documented #7721

Closed
vicuna opened this issue Feb 5, 2018 · 2 comments
Closed

Comments

@vicuna
Copy link

vicuna commented Feb 5, 2018

Original bug ID: 7721
Reporter: sbleazard
Status: new
Resolution: open
Priority: low
Severity: feature
Version: 4.06.0
Category: runtime system and C interface
Monitored by: sbleazard

Bug description

When interfacing to C it is fairly common to store a C data structure in an ocaml value without needing any of the additional functionality provided by caml_alloc_custom. Some people recommend caml_alloc_string for this but that seems wrong.

Can caml_alloc_abstract(n) be added to allocate an n-byte abstract value? This could then be used when a simple block of data is required to store some C data that will not be compared nor serialised but will be garbage collected once out of scope.

Also, the manual does not really cover the Abstract_tag very much as I think this is what I need but it's unclear

@vicuna
Copy link
Author

vicuna commented Feb 12, 2018

Comment author: sbleazard

#1602 (#1602) raised to resolve this issue

@gasche
Copy link
Member

gasche commented Nov 7, 2019

For now there is no support for making it easier to allocate Abstract values, with consensus that people should use Custom values instead. I'm closing this issue.

(Apologies @stevebleazard for the negative response to your work...)

@gasche gasche closed this as completed Nov 7, 2019
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