Version française
Home     About     Download     Resources     Contact us    
Browse thread
unboxing options
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Christophe Raffalli <christophe.raffalli@u...>
Subject: Re: [Caml-list] unboxing options
Mike Hamburg wrote:
> Why should we need an "unboxed" keyword?  Is there any reason why the
> user should want things to be boxed?

Yes many reason:

- Unboxing of data structure prevent sharing of data structure and
therefore:
   1 it may increase the memory usage
   2 it changes the semantics in presence of mutable data or ==
   3 it cost time to get the data out of the structure (needs copying)

So in fact, you only want unboxing for small object that have little
chance to be shared.

You could correct 2 and 3 if you allow pointer in the middle of the data
structure, but this is a nightmare for GC and runtime ...


--
Christophe Raffalli
Université de Savoie
Batiment Le Chablais, bureau 21
73376 Le Bourget-du-Lac Cedex

tél: (33) 4 79 75 81 03
fax: (33) 4 79 75 87 42
mail: Christophe.Raffalli@univ-savoie.fr
www: http://www.lama.univ-savoie.fr/~RAFFALLI
---------------------------------------------
IMPORTANT: this mail is signed using PGP/MIME
At least Enigmail/Mozilla, mutt or evolution
can check this signature. The public key is
stored on www.keyserver.net
---------------------------------------------