Version française
Home     About     Download     Resources     Contact us    
Browse thread
[Caml-list] Stopping a value from getting GC'd
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Nathaniel Gray <n8gray@g...>
Subject: Re: [Caml-list] Cost of register_global_root
On 8/17/05, Alain Frisch <Alain.Frisch@inria.fr> wrote:
> Nathaniel Gray wrote:
> > One thing that the FM doesn't mention is how expensive it is to
> > register a global root.  Can I register thousands of them or will
> > there be performance problems?
> 
> The runtime system stores the global roots in a skip list. One should
> expect probabilistic O(log n) complexity with a small constant for each
> insertion and deletion, where n is the number of already registered
> global roots.

Sounds reasonable.

> Another option is to manage the roots yourself (e.g. you put them in an
> array and store indexes into this array in your custom data structure).

That's exactly what I was planning, but I wasn't entirely sure it was
actually necessary.

> This might be necessary if the custom blocks are under the control of
> another memory management system which can moves blocks around.

Thanks,
-n8

-- 
>>>-- Nathaniel Gray -- Caltech Computer Science ------>
>>>-- Mojave Project -- http://mojave.cs.caltech.edu -->