caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Jean-Christophe Filliatre <Jean-Christophe.Filliatre@lri.fr>
To: dmitry grebeniuk <gds-mlsts@moldavcable.com>
Cc: caml-list@inria.fr
Subject: Re: [Caml-list] GC question
Date: Wed, 6 Jul 2005 09:29:25 +0200	[thread overview]
Message-ID: <17099.34901.255318.655546@gargle.gargle.HOWL> (raw)
In-Reply-To: <1082353890.20050705105902@moldavcable.com>


dmitry grebeniuk writes:
 > 
 >   I have some objects (custom blocks with method suite attached)
 > which can be referenced from caml heap.  How to ensure that
 > finalisation function is called for all non-referenced objects?
 > I know, call to caml_gc_full_major(Val_unit) will do this work,
 > but it can be costly when there are many values on the heap
 > (or not?).  Are there any quicker solution?  (I can make no
 > assumptions about "age" (young/old) of allocated custom blocks
 > and about current GC state)

The two integer parameters "used" and "max" passed to alloc_custom are
controlling how fast the custom blocks are reclaimed by the GC, as
explained in section 18.9.2 of the manual
(see http://caml.inria.fr/pub/docs/manual-ocaml/manual032.html).

I don't think that calling caml_gc_full_major by yourself is a good
idea. You should trust the GC; it will eventually reclaim any block
that is not referenced anymore.

Hope this helps,
-- 
Jean-Christophe


  reply	other threads:[~2005-07-06  7:29 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-07-05  7:59 dmitry grebeniuk
2005-07-06  7:29 ` Jean-Christophe Filliatre [this message]
  -- strict thread matches above, loose matches on Subject: below --
2005-10-24 17:53 MATTHEW HAMMER
2005-10-25 18:41 ` [Caml-list] " Damien Doligez
2005-10-25 19:20   ` MATTHEW HAMMER
2005-10-27 14:25     ` Damien Doligez
2003-09-08  9:52 [Caml-list] Native compiler support for m68k? Damien Doligez
2003-09-08 20:36 ` [Caml-list] GC Question Christophe Raffalli
2003-09-09  9:32   ` Pierre Weis
2003-09-09 10:40     ` Christophe Raffalli
2003-09-11 15:04   ` Xavier Leroy

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=17099.34901.255318.655546@gargle.gargle.HOWL \
    --to=jean-christophe.filliatre@lri.fr \
    --cc=caml-list@inria.fr \
    --cc=gds-mlsts@moldavcable.com \
    /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;
as well as URLs for NNTP newsgroup(s).