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 MAA14958; Thu, 10 Apr 2003 12:35:36 +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 MAA14904 for ; Thu, 10 Apr 2003 12:35:34 +0200 (MET DST) Received: from fichte.ai.univie.ac.at (fichte.ai.univie.ac.at [131.130.174.156]) by nez-perce.inria.fr (8.11.1/8.11.1) with ESMTP id h3AAZX904357 for ; Thu, 10 Apr 2003 12:35:33 +0200 (MET DST) 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-6.3) with ESMTP id h3AAZLgN031933; Thu, 10 Apr 2003 12:35:21 +0200 Received: (from markus@localhost) by fichte.ai.univie.ac.at (8.12.3/8.12.3/Debian-6.3) id h3AAZJuw031932; Thu, 10 Apr 2003 12:35:19 +0200 Date: Thu, 10 Apr 2003 12:35:19 +0200 From: Markus Mottl To: Jean-Christophe Filliatre Cc: Brian Hurt , "Yaron M. Minsky" , Caml List Subject: Re: [Caml-list] Re: Wanted - General Purpose "Glue Logic" Data-Structures Message-ID: <20030410103518.GA31212@mail4.ai.univie.ac.at> Mail-Followup-To: Jean-Christophe Filliatre , Brian Hurt , "Yaron M. Minsky" , Caml List References: <16019.49880.45938.429789@gargle.gargle.HOWL> <16021.10090.355061.746312@gargle.gargle.HOWL> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <16021.10090.355061.746312@gargle.gargle.HOWL> User-Agent: Mutt/1.3.28i Organization: Austrian Research Institute for Artificial Intelligence X-Spam: no; 0.00; caml-list:01 glue:01 filliatre:01 deallocate:01 decreased:99 overwrite:01 finalizers:01 monitored:99 arrays:01 mottl:02 wrote:03 dependent:03 obj:03 library:03 object:03 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk On Thu, 10 Apr 2003, Jean-Christophe Filliatre wrote: > In the solution I proposed, you do not deallocate the array block when > you delete the last element; only the size is decreased. There is one problem with this: you still need to fill in an object. If you use one provided by the user, this will consume memory dependent on the object size. Therefore, it is usually best to overwrite the slot using evil "Obj.magic" inside of the library. Note that there may also be finalizers associated with the value or it may be monitored by weak arrays. Regards, Markus Mottl -- Markus Mottl http://www.oefai.at/~markus markus@oefai.at ------------------- 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