Version française
Home     About     Download     Resources     Contact us    
Browse thread
[Caml-list] Efficiency of 'a list
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Falk Hueffner <falk.hueffner@s...>
Subject: Re: [Caml-list] Efficiency of 'a list
Eray Ozkural <exa@kablonet.com.tr> writes:

> To be precise, comparing an int list and int array we'll see that
> list occupies twice the same memory

Thrice, actually. AFAIK, lists behave exactly like

type 'a list =
  Nil
| Cons of 'a * 'a list

and therefore require an extra header word that will keep the
enumeration number, allocation size and temporary GC information.

-- 
	Falk

-------------------
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