caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: "Juan J. Quintela" <quintela@fi.udc.es>
To: David.Mentre@irisa.fr (David Mentré)
Cc: caml-list@inria.fr
Subject: Re: Calling C from OCaml, GC problems
Date: 18 Feb 2000 11:48:43 +0100	[thread overview]
Message-ID: <yttitzmyees.fsf@krilin.dc.fi.udc.es> (raw)
In-Reply-To: David.Mentre@irisa.fr's message of "16 Feb 2000 16:41:42 +0100"


> value mlbdd_alloc_manager(MANAGER m) {
>        CAMLparam0();
>        CAMLlocal1 (result);  

>        bdd_overflow_closure(m, mlbdd_overflow, NULL);
>        result = alloc_final(Size_ml_manager, mlbdd_free_manager, 0, 1);
>        Manager_store_pointer(result, (value)m);
>        PRINT_DEBUG("Alloc manager");
>        CAMLreturn result;
>}

I think you need to protect m with 
CAMLparam1(m);
otherwise in the allocation alloc_final, the garbage collector can be
called and the address to m change.

I hope this help.

Later, Juan.

-- 
In theory, practice and theory are the same, but in practice they 
are different -- Larry McVoy



  parent reply	other threads:[~2000-02-21 17:06 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2000-02-16 15:41 David Mentré
2000-02-18  1:26 ` Markus Mottl
2000-02-18  9:45 ` Xavier Leroy
2000-02-21 16:54   ` David Mentré
2000-02-21 23:41     ` Max Skaller
2000-02-18 10:48 ` Juan J. Quintela [this message]
2000-02-21 13:40   ` David Mentré
2000-02-23 19:39 Damien Doligez
2000-02-24 23:36 ` Max Skaller

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=yttitzmyees.fsf@krilin.dc.fi.udc.es \
    --to=quintela@fi.udc.es \
    --cc=David.Mentre@irisa.fr \
    --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).