Version française
Home     About     Download     Resources     Contact us    

This site is updated infrequently. For up-to-date information, please visit the new OCaml website at

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: 2002-02-22 (18:04)
From: Winfried Dreckmann <wd@l...>
Subject: Re: [Caml-list] local root registration
on 22.02.2002 15:27 Uhr, Markus Mottl 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.

Winfried Dreckmann

To unsubscribe, mail Archives:
Bug reports: FAQ:
Beginner's list: