caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: "Florian Douetteau" <Florian.Douetteau@ens.fr>
To: "Mary F. Fernandez" <mff@research.att.com>
Cc: <caml-list@inria.fr>
Subject: Re: [Caml-list] Question about register_global_root
Date: Sun, 1 Jun 2003 21:19:46 +0200	[thread overview]
Message-ID: <00a601c32872$c3db0740$0201a8c0@foorama> (raw)
In-Reply-To: <3ED511E5.8060401@research.att.com>



As far as i understand the caml gc, it only scans blocks pointing to memory
blocks allocated through caml allocation functions
The reason of this is to allow pointers C values allocated C heap to be
pointed directly by caml values
(As shown in the unix-curses exemple at
http://caml.inria.fr/ocaml/htmlman/manual032.html#htoc224)

if you try to allocate C values in C malloc heap, it just won't work (your C
values won't be scanned, and those allocated in the original caml heap
only pointed by your caml values in C heap, will be reclaimed too soon)

Hope this helps ...


----- Original Message ----- 
From: "Mary F. Fernandez" <mff@research.att.com>
To: <caml-list@inria.fr>; "Jerome Simeon" <simeon@research.bell-labs.com>
Sent: Wednesday, May 28, 2003 9:45 PM
Subject: [Caml-list] Question about register_global_root


> Hi Caml experts,
> We are using register_global_root to register addresses in the malloc'd
> C heap that contain Caml values.  We noticed that register_global_root
> (comment below) expects a global C variable, but we assumed that it should
> work with malloc'd addresses as well.  Is there any reason that it would
not?
>
> /* [register_global_root] registers a global C variable as a memory root
>     for the duration of the program, or until [remove_global_root] is
>     called. */
>
> We are getting (somewhat random) core dumps after calling the same Caml
> function repeatedly on the same Caml value (which is referenced
> from the C heap).
>
> Thanks,
> Mary
> -- 
> Mary Fernandez, Principal Technical Staff Member
> AT&T Labs - Research, 180 Park Ave., Room E243, Florham Park, NJ
07932-0971
> phone: 973-360-8679,  fax: 973-360-8187
> mff@research.att.com, http://www.research.att.com/~mff
>
>
> -------------------
> To unsubscribe, mail caml-list-request@inria.fr Archives:
http://caml.inria.fr
> Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ:
http://caml.inria.fr/FAQ/
> Beginner's list: http://groups.yahoo.com/group/ocaml_beginners
>

-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners


      parent reply	other threads:[~2003-06-01 19:17 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-05-28 19:45 Mary F. Fernandez
2003-05-28 19:51 ` Alexander V. Voinov
2003-05-28 20:33 ` Maas-Maarten Zeeman
2003-05-29  1:31   ` Jerome Simeon
2003-06-01  7:24   ` Chris Hecker
2003-06-01 10:50     ` Maas-Maarten Zeeman
2003-06-01 11:10       ` Chris Hecker
2003-06-01 19:53       ` Damien Doligez
2003-06-02 11:37         ` Jerome Simeon
2003-06-02 12:11           ` Maas-Maarten Zeeman
2003-06-02 12:19             ` [Caml-list] Am I mad?: OCaml for scientific scripting Siegfried Gonzi
2003-06-02 12:21             ` Siegfried Gonzi
2003-06-02 16:21         ` [Caml-list] Question about register_global_root Harry Chomsky
2003-06-02 20:02           ` Maas-Maarten Zeeman
2003-06-03  0:05             ` Chris Hecker
2003-06-01 19:19 ` Florian Douetteau [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='00a601c32872$c3db0740$0201a8c0@foorama' \
    --to=florian.douetteau@ens.fr \
    --cc=caml-list@inria.fr \
    --cc=mff@research.att.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).