Version française
Home     About     Download     Resources     Contact us    
Browse thread
A list of finalized values ?
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Xavier Leroy <Xavier.Leroy@t...>
Subject: Re: A list of finalized values ?
> I try to build a list of finalized values in C and use it under Caml.
> If I use alloc_final with used=0 and max=1, no problem, that works.

I don't think it does.  Finalized blocks must not contain any pointers
into the Caml heap.  Your sample code seems to do this.

Rather than finalize the cons cells of the list, you should build a
regular list and wrap each element of the list in a finalized block.
Again, this assumes that the list elements are not Caml pointers but
e.g. pointers into the C heap.

Hope this helps,

- Xavier Leroy