Version française
Home     About     Download     Resources     Contact us    
Browse thread
[Caml-list] local root registration
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Winfried Dreckmann <wd@l...>
Subject: Re: [Caml-list] local root registration
on 22.02.2002 15:27 Uhr, Markus Mottl at markus@oefai.at wrote:

> I can't remember that there were intentions to remove them. They rather
> seem to be discouraged in favour of the new scheme whenever the latter
> can be applied without tradeoffs.

Yes. Maybe I misinterprete "supersede" in the documentation.

> There should certainly be an efficient way to conditionally protect
> roots, which cannot be done with the new macro scheme.

That's what I mean. Thank you for expressing it in a few words.

>> (see "lib/common/ml-alloc.h" in the numerix distribution). In this way,
>> the price for garbage collection is only paid if allocation actually
>> takes place. It seems impossible to achieve the same effect with
>> CAMLxxx macros.
> 
> If I am not seriously mistaken, only allocations on the OCaml-heap can
> trigger a collection. There is just a small overhead associated with
> (un)registering OCaml-values as reachable, but it's certainly a good idea
> to remove every kind of unnecessary overhead in performance-critical code.

I should have written "the price for registering is only paid if ...". Yes,
the Ocaml interface for Numerix allocates on the Ocaml heap. Yes, the
overhead would be small. But in some cases (lots of operations on "small"
big integers) this makes a difference.

Regards,
Winfried Dreckmann

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