Mantis Bug Tracker

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0006434OCamlruntime system and C interfacepublic2014-05-20 02:022016-04-05 16:06
Assigned Todoligez 
PrioritynormalSeverityminorReproducibilityhave not tried
StatusclosedResolutionno change required 
PlatformOSOS Version
Product Version 
Target VersionFixed in Version 
Summary0006434: caml_final_release is not declared in finalise.h
DescriptionShould be clear from subject.
TagsNo tags attached.
Attached Files

- Relationships

-  Notes
doligez (administrator)
2014-05-21 16:31

This is a primitive that you're supposed to call from OCaml, not from C, so it doesn't need to be declared in the .h. Do you have a use case for calling it from C?
whitequark (developer)
2014-05-21 18:38

I think I did, but not I'm not sure. A previous design of finalizers in ocaml-zmq was supposed to have a finalizer that doesn't terminate for a long time. But we went away from that design already.

Generally, wouldn't the use cases for calling it from C be the same as for finalizers written in OCaml?
doligez (administrator)
2014-07-16 18:17

There are two kinds of finalisers/finalizers:

Finalizers are written in C and used for custom objects.
Finalisers are written in OCaml and used with Gc.finalise.

caml_final_release is for the second kind. I suppose you might want to call it from a C primitive called by your OCaml finalisation function, but I don't see much use for that. At worst you can do it with a callback (!) or call it before you call your C primitive.
whitequark (developer)
2014-07-22 15:42

Does caml_final_release not work with finalizers written in C? I don't see anything conceptually different between releasing the runtime from a C finalizer or OCaml finalizer.
doligez (administrator)
2016-04-05 16:05

A C finalizer runs in the middle of garbage collection. That's definitely not a safe point for releasing the runtime.

- Issue History
Date Modified Username Field Change
2014-05-20 02:02 whitequark New Issue
2014-05-21 16:31 doligez Note Added: 0011531
2014-05-21 16:31 doligez Assigned To => doligez
2014-05-21 16:31 doligez Status new => feedback
2014-05-21 18:38 whitequark Note Added: 0011537
2014-05-21 18:38 whitequark Status feedback => assigned
2014-07-16 18:17 doligez Note Added: 0011864
2014-07-16 18:17 doligez Target Version => 4.03.0+dev / +beta1
2014-07-22 15:42 whitequark Note Added: 0011898
2016-04-05 16:05 doligez Note Added: 0015677
2016-04-05 16:06 doligez Status assigned => closed
2016-04-05 16:06 doligez Resolution open => no change required
2016-04-05 16:06 doligez Target Version 4.03.0+dev / +beta1 =>
2017-02-23 16:43 doligez Category OCaml runtime system => runtime system
2017-03-03 17:45 doligez Category runtime system => runtime system and C interface

Copyright © 2000 - 2011 MantisBT Group
Powered by Mantis Bugtracker