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 OAA26316; Mon, 30 Aug 2004 14:24:04 +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 OAA25166 for ; Mon, 30 Aug 2004 14:24:03 +0200 (MET DST) Received: from pauillac.inria.fr (pauillac.inria.fr [128.93.11.35]) by nez-perce.inria.fr (8.13.0/8.13.0) with ESMTP id i7UCO3Ib004429 for ; Mon, 30 Aug 2004 14:24:03 +0200 Received: from bourg.inria.fr (bourg.inria.fr [128.93.11.100]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id OAA25163 for ; Mon, 30 Aug 2004 14:24:02 +0200 (MET DST) Received: from basile by bourg.inria.fr with local (Exim 4.34) id 1C1lC8-0001wp-Np for caml-list@inria.fr; Mon, 30 Aug 2004 14:23:32 +0200 Date: Mon, 30 Aug 2004 14:23:32 +0200 To: caml-list@inria.fr Subject: Re: [Caml-list] Re: (GC issues) Alternative Bytecodes for OCaml Message-ID: <20040830122332.GA7426@bourg.inria.fr> References: <004f01c48c19$9950d8e0$0100a8c0@warp> <412F9059.2080808@orcaware.com> <20040827221801.GB1545@annexia.org> <20040828.083835.21913928.yoriyuki@mbg.ocn.ne.jp> <20040828164012.GA6420@bourg.inria.fr> <003f01c48d20$fa1497e0$0100a8c0@warp> <20040828204554.GA9252@bourg.inria.fr> <005101c48db0$a2da9110$0100a8c0@warp> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline In-Reply-To: <005101c48db0$a2da9110$0100a8c0@warp> User-Agent: Mutt/1.5.6+20040803i From: "Basile Starynkevitch [local]" X-Miltered: at nez-perce with ID 41331C63.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Loop: caml-list@inria.fr X-Spam: no; 0.00; caml-list:01 bytecodes:01 basile:01 basile:01 2004:99 cannasse:01 allocations:01 allocations:01 allocating:01 ocaml's:01 pointers:01 compactor:01 pointers:01 ocaml's:01 patched:01 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk On Sun, Aug 29, 2004 at 12:12:05PM +0200, Nicolas Cannasse wrote: > > > * OCaml GC but with all C allocations made directly into the old > > > generation (for conservativness) > > > > You still has to tell the (exact) minor collector about these > > allocations (ie something like putting them on the store list) - so > > you won't gain much in C coding style, and you'll lose in > > performance. The result of C primitives is usually a temporary value > > (e.g. because C primitives tend to be wrapped by Ocaml code doing > > checking and changing C errors into Ocaml exceptions), so you'll > > probably better put then in the young generation. > > Since old generation collection is mostly conservative (compaction taken > appart) , allocating *by default* into the old generation and having a C > stack scanner could be a good compromise. [....] No, Ocaml's major GC (the garbage collection of the old generation) is not conservative; it is precise (it knows exactly where the pointers are), but is an incremental mark&sweep - with occasionnal call to the compactor whichs compacts the whole heap (including old stuff) by moving values & updating pointers. So I don't think Ocaml's GC could be easily patched to have the old GC work conservatively - hence avoiding the requirement of telling the runtime what are the pointers (ie CAMLlocal* & CAMLparam* macros). (I'm not sure that Nicolas Cannasse uses the "conservative" word in the established sense of the GC experts - perhaps my previous explanations where not clear enough). There is no way to conservatively scan the C stack, because the Ocaml GC may move pointers (and it has to, in order to be performant). (Damien Doligez would probably explain better than I could) Regards. -- Basile STARYNKEVITCH -- basile dot starynkevitch at inria dot fr other email : basile at starynkevitch dot net Project cristal.inria.fr - temporarily http://cristal.inria.fr/~starynke --- all opinions are only mine ------------------- 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