From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from majordomo@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id VAA20145; Sun, 1 Jun 2003 21:17:14 +0200 (MET DST) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id VAA20102 for ; Sun, 1 Jun 2003 21:17:12 +0200 (MET DST) Received: from mwinf0602.wanadoo.fr (smtp3.wanadoo.fr [193.252.22.25]) by nez-perce.inria.fr (8.11.1/8.11.1) with ESMTP id h51JHCT27618 for ; Sun, 1 Jun 2003 21:17:12 +0200 (MET DST) Received: from foorama (unknown [217.128.252.110]) by mwinf0602.wanadoo.fr (SMTP Server) with SMTP id BE7265400280; Sun, 1 Jun 2003 21:17:11 +0200 (CEST) Message-ID: <00a601c32872$c3db0740$0201a8c0@foorama> From: "Florian Douetteau" To: "Mary F. Fernandez" Cc: References: <3ED511E5.8060401@research.att.com> Subject: Re: [Caml-list] Question about register_global_root Date: Sun, 1 Jun 2003 21:19:46 +0200 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2800.1158 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165 X-Spam: no; 0.00; florian:01 douetteau:01 caml-list:01 pointers:01 malloc:01 reclaimed:01 mff:99 jerome:01 simeon:01 973:99 bug:01 faq:01 beginner's:01 beginners:01 bin:01 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk 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" To: ; "Jerome Simeon" 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