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 NAA21853; Fri, 21 Mar 2003 13:03:28 +0100 (MET) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id NAA21467 for ; Fri, 21 Mar 2003 13:03:26 +0100 (MET) Received: from fichte.ai.univie.ac.at (fichte.ai.univie.ac.at [131.130.174.156]) by concorde.inria.fr (8.11.1/8.11.1) with ESMTP id h2LC3Pf09334 for ; Fri, 21 Mar 2003 13:03:25 +0100 (MET) Received: from fichte.ai.univie.ac.at (markus@localhost.ai.univie.ac.at [127.0.0.1]) by fichte.ai.univie.ac.at (8.12.3/8.12.3/Debian-5) with ESMTP id h2LC32V7024629; Fri, 21 Mar 2003 13:03:02 +0100 Received: (from markus@localhost) by fichte.ai.univie.ac.at (8.12.3/8.12.3/Debian-5) id h2LC32cI024628; Fri, 21 Mar 2003 13:03:02 +0100 Date: Fri, 21 Mar 2003 13:03:02 +0100 From: Markus Mottl To: Christopher Quinn Cc: OCAML Subject: Re: [Caml-list] GC and preventing data relocation Message-ID: <20030321120302.GC23641@fichte.ai.univie.ac.at> Mail-Followup-To: Christopher Quinn , OCAML References: <20030320151647.GA15121@fichte.ai.univie.ac.at> <3E7A0861.9020607@htec.demon.co.uk> <20030321000134.GA17993@fichte.ai.univie.ac.at> <3E7A67C6.5030302@htec.demon.co.uk> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <3E7A67C6.5030302@htec.demon.co.uk> User-Agent: Mutt/1.4i Organization: Austrian Research Institute for Artificial Intelligence X-Spam: no; 0.00; caml-list:01 ocaml-heap:01 glue:01 c-library:01 callback:01 opaque:01 offsets:01 pointers:01 low-level:01 runtime:01 quinn:01 ocaml:01 caml:01 mottl:02 pointer:03 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk On Fri, 21 Mar 2003, Christopher Quinn wrote: > Markus Mottl wrote: > >I don't quite understand this solution. How should this prevent the > >string from being relocated if the string was allocated in the OCaml-heap? > > it wouldn't, but at least the pointer to it is changed also. and the > assumption i made was that the glue code knows where it is keeping its > pointer to the string. Well, the glue code can surely know, but unfortunately things are more complicated, because the C-library can't: OCaml | +--> C-glue code | +--> C-library | +-----> +--> C-glue code (via "callout" function pointer) | | | +--> OCaml (callback) | problem is here Once the opaque C-library runs off with a given pointer to a string, it may generate tons of internal datastructures that depend on this specific location. There is just no way for me to tell the C-library to continue elsewhere, because the C-library called me (the glue code) before the OCaml-callback, not vice versa, and just expects me to return. Well, I could ask the author of the C-library to add a feature that adds offsets at each step to dependent pointers to accommodate for relocations. But he'll probably rather kill me than rewrite 7 KLOCs of low-level code... ;-) > >And wouldn't be particulary portable... > > what 3rd party modification to the distributed caml runtime is!? Indeed... Regards, Markus Mottl -- Markus Mottl markus@oefai.at Austrian Research Institute for Artificial Intelligence http://www.oefai.at/~markus ------------------- 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