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 TAA00319; Thu, 20 Mar 2003 19:30:19 +0100 (MET) 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 TAA00392 for ; Thu, 20 Mar 2003 19:30:18 +0100 (MET) Received: from t2.fast.net.uk (ns1.fast.net.uk [212.42.162.2]) by nez-perce.inria.fr (8.11.1/8.11.1) with ESMTP id h2KIUHX12250 for ; Thu, 20 Mar 2003 19:30:17 +0100 (MET) Received: from htec.demon.co.uk (adsl-212-42-169-63.fast.net.uk [212.42.169.63]) by t2.fast.net.uk (8.11.6/8.11.4) with ESMTP id h2KIToN44384; Thu, 20 Mar 2003 18:30:01 GMT Message-ID: <3E7A0861.9020607@htec.demon.co.uk> Date: Thu, 20 Mar 2003 18:28:49 +0000 From: Christopher Quinn User-Agent: Mozilla/4.61 [en] (X11; I; Linux 2.2.12-20 i686) X-Accept-Language: en-us, en MIME-Version: 1.0 To: Markus Mottl CC: OCAML Subject: Re: [Caml-list] GC and preventing data relocation References: <20030320151647.GA15121@fichte.ai.univie.ac.at> In-Reply-To: <20030320151647.GA15121@fichte.ai.univie.ac.at> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Spam: no; 0.00; caml-list:01 c-library:01 struct:01 invocation:01 compactor:01 runtime:01 chunks:01 val:01 chris:01 quinn:01 caml:01 int:01 htec:01 patch:02 mottl:02 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk Markus Mottl wrote: > Since there is no way for me to tell the C-library to continue with a > new location of the string, I'd like to know whether there is any way > to prevent the GC from moving specific data? > > Best regards, > Markus Mottl > i looked into this and came up with: a) if you have C-heap struct specific to each invocation, register the field holding the string pointer as a caml root, deregister it on completion. but that is more overhead. b) add a CString_tag to the set of value tags, modify the compactor() routine to take acccount of it, and change the tag of a regular string at runtime. unfortunately this scheme greatly inconveniences the design of the compactor and would likely slow it down. c) differentiate static from dynamic 'chunks' and allocate strings from static chunks. this still allows GC to be done on static values but is easily integrated into the compactor. interface: val Cstring.make: int -> string ... as normal. i have a patch for this if you are interested. it is all down to the compactor and the current version treats values indifferently. - chris ------------------- 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