From: Robbert VanRenesse <rvr@cs.cornell.edu>
To: caml-list@pauillac.inria.fr
Subject: Final_tag and garbage collection
Date: Mon, 6 Nov 1995 14:33:02 -0500 [thread overview]
Message-ID: <199511061933.OAA01340@snotra.cs.cornell.edu> (raw)
The system that I'm building uses a mixture of C and CAML. Sometimes it is
necessary to have references from CAML objects to C objects. When CAML
cleans up its objects, the C objects need to be cleaned up as well. I'm
using the finalization functionality of CAML for that. However, it only
appears to work reliably in combination with alloc_shr(), not with alloc().
Here's the code:
value link;
link = alloc_shr(3, Final_tag);
Field(link, 0) = (value) link_final;
...
Very reliably, the function link_final is automatically invoked when the
system is garbage collecting. However, if I use alloc() instead, it
sometimes happens, but lots of blocks appear to not get finalized. I
used all of gc__minor, gc__major, and gc__fullmajor to try to provoke
finalization, but only a subset of what I allocated this way gets
finalized.
Any ideas?
Robbert
next reply other threads:[~1995-11-07 12:48 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
1995-11-06 19:33 Robbert VanRenesse [this message]
1995-11-08 13:56 Damien Doligez
[not found] <199511081442.PAA14390@pauillac.inria.fr>
1995-11-08 14:51 ` Franck Delaplace
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=199511061933.OAA01340@snotra.cs.cornell.edu \
--to=rvr@cs.cornell.edu \
--cc=caml-list@pauillac.inria.fr \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox