On Sun, Jan 05, 2014 at 06:07:33PM +0100, Sven Hartrumpf wrote:
> Hi all.
> 
> Is there a recommended way to declare some large expressions (> 100 MB)
> in a compiled program as read-only and more importantly
> as not gc-able (the garbage collector should be saved from traversing
> these large structures again and again)?
> Should the constant value be compiled in or should it be read from a file?
> Is define-constant the right way to go?
> (How do other Scheme implementation handle such cases?)

Hi Sven,

I don't know if define-constant helps.  I don't think it does,
but I might be wrong.  Perhaps you can use object-evict!, but
that means it won't ever be reclaimed by the GC.  I haven't used
this myself yet, so I don't know if there's a way to "un-evict" the
object when it can be GC'ed.

Depending on the task, you could also just malloc some foreign object
and provide foreign-lambda or foreign-primitive accessors to reach
into the object.

Cheers,
Peter
-- 
http://www.more-magic.net

_______________________________________________
Chicken-users mailing list
[email protected]
https://lists.nongnu.org/mailman/listinfo/chicken-users

Reply via email to