English version
Accueil     À propos     Téléchargement     Ressources     Contactez-nous    

Ce site est rarement mis à jour. Pour les informations les plus récentes, rendez-vous sur le nouveau site OCaml à l'adresse ocaml.org.

Browse thread
[Caml-list] Wanted - General Purpose "Glue Logic" Data-Structures
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2003-04-10 (10:35)
From: Markus Mottl <markus@o...>
Subject: Re: [Caml-list] Re: Wanted - General Purpose "Glue Logic" Data-Structures
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.

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