caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: "Török Edwin" <edwin+ml-ocaml@etorok.net>
To: caml-list@inria.fr
Subject: Re: [Caml-list] Mismatch between Gc.full_major() documentation and behaviour
Date: Wed, 11 Dec 2013 15:01:45 +0200	[thread overview]
Message-ID: <52A86239.30107@etorok.net> (raw)
In-Reply-To: <52A8508D.2050000@inria.fr>

On 12/11/2013 01:46 PM, Bertrand Jeannet wrote:
> According to the documentation, the sequence
> "Gc.major();Gc.full_major()" should be equivalent to
> "Gc.full_major()", as Gc.full_major() is told to terminate the
> current major gc and perform a complete new cycle.

They both perform a minor GC cycle too.
So you run a minor cycle twice with 'Gc.major(); Gc.full_major()', but only one with 'Gc.full_major()'.

> 
> In my case it is not the case: "Gc.major(); Gc.full_major()" performs
> more calls to finalisation functions than "Gc.full_major()".
> 
> My context: I use a weak hashtables containing finalised value (with
> Gc.finalise).
> 
> The documentation of Weak module specifies that the finalization
> function is called after the weak hashtbl/array has been set to
> none.
> 
> Does someone know the explanation of this ?

You can run 'Gc.print_stat stderr' to check how many GC minor/major cycles are run in both cases. The number of minor cycles should be different.

Best regards,
--Edwin

      reply	other threads:[~2013-12-11 13:01 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-12-11 11:46 Bertrand Jeannet
2013-12-11 13:01 ` Török Edwin [this message]

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=52A86239.30107@etorok.net \
    --to=edwin+ml-ocaml@etorok.net \
    --cc=caml-list@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;
as well as URLs for NNTP newsgroup(s).