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 LAA25340; Wed, 17 Apr 2002 11:23:08 +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 LAA21397 for ; Wed, 17 Apr 2002 11:23:07 +0200 (MET DST) Received: from kiefer.ai.univie.ac.at (kiefer.ai.univie.ac.at [131.130.174.157]) by nez-perce.inria.fr (8.11.1/8.11.1) with ESMTP id g3H9N5X06177 for ; Wed, 17 Apr 2002 11:23:06 +0200 (MET DST) Received: (from markus@localhost) by kiefer.ai.univie.ac.at (8.9.3/8.9.3/Debian 8.9.3-21) id LAA20697; Wed, 17 Apr 2002 11:22:52 +0200 Date: Wed, 17 Apr 2002 11:22:52 +0200 From: Markus Mottl To: Scott Cyphers Cc: Brian Rogoff , Martin Jambon , caml-list@inria.fr Subject: Re: [Caml-list] Memory leak Message-ID: <20020417092252.GA20621@kiefer.ai.univie.ac.at> Mail-Followup-To: Scott Cyphers , Brian Rogoff , Martin Jambon , caml-list@inria.fr References: <001e01c1e597$e2ca84b0$17011b12@BEARWITHME> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <001e01c1e597$e2ca84b0$17011b12@BEARWITHME> User-Agent: Mutt/1.3.26i Organization: Austrian Research Institute for Artificial Intelligence Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk On Tue, 16 Apr 2002, Scott Cyphers wrote: > > Sure. There was a great demo of this on the translator's list for the > > O'Reilly book; create a representation of stacks based on arrays with a > > top of stack index. Popping items off of the stack by moving the TOS > > pointer around won't free them. Could you be doing something like that? > > In that particular case, the stack implementation is a lot uglier when you > need to provide the ability to neutralize array elements of arbitrary type > as you pop the stack. Sometimes you get lulled into thinking the GC works > completely invisibly. In case you ever need such functionality (stacks based on arrays), you might want to try the library of resizable arrays called RES, which also handles resizable strings: http://www.ai.univie.ac.at/~markus/home/ocaml_sources.html It plays some naughty low-level tricks to free memory of unreachable values, which occur when some resizable array shrinks. 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