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

Finalisation depuis le C #4376

Closed
vicuna opened this issue Sep 4, 2007 · 3 comments
Closed

Finalisation depuis le C #4376

vicuna opened this issue Sep 4, 2007 · 3 comments

Comments

@vicuna
Copy link

vicuna commented Sep 4, 2007

Original bug ID: 4376
Reporter: @alainfrisch
Status: closed (set by @alainfrisch on 2016-12-08T15:43:59Z)
Resolution: won't fix
Priority: normal
Severity: feature
Category: ~DO NOT USE (was: OCaml general)

Bug description

La finalisation est souvent utile dans du code de bas-niveau, par exemple dans une interface avec une bibliothèque C. Il serait agréable de pouvoir ajouter un finalisateur directement depuis le C. On peut certe appeler caml_final_register, mais il faut lui donner une fermeture Caml, alors que l'on voudrait parfois donner un pointeur vers une fonction C de type void (*)(value). Cela semble assez trivial à faire: au lieu de faire caml_callback(f.fun,f.val), il suffit de tester si f.fun est un pointeur dans le tas Caml (faire caml_callback) ou non (appel direct de fonction C).

@vicuna
Copy link
Author

vicuna commented Nov 21, 2007

Comment author: @damiendoligez

La solution proposee est beaucoup trop fragile. Pour faire propre,
il faudra ajouter une fonction caml_final_register_c.

@vicuna
Copy link
Author

vicuna commented Dec 8, 2016

Comment author: @mshinwell

@Frisch Do you still argue for this? It isn't clear to me whether it's worth the time spent to implement [a function such as @doligez argues for].

@vicuna
Copy link
Author

vicuna commented Dec 8, 2016

Comment author: @alainfrisch

No, I'm not arguing for it.

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

1 participant