chicken-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Chicken-users] set-finalizer! and cons


From: Zbigniew
Subject: Re: [Chicken-users] set-finalizer! and cons
Date: Fri, 20 Jan 2006 02:45:59 -0600

Thanks for the excellent explanation.  Increasing the buffer size does work.

A dumb mistake is also obvious in retrospect.  I had written a
fold-right (recursive) function, and even when the incoming "kons"
converts NSStrings to scheme strings, a full chain of recursive calls
(and objc:instances) will be built before any konsing occurs at all. 
Since I was just using the fold function in ns:array->list and
ns:dictionary->alist, I changed it to a fold-left (iterative) and
tacked a reverse onto the ns:array->list.  Et voila, a large array of
NSStrings converts immediately.  You do still have to watch out for
unconvertable objects, for example an ns:array containing 5607
ns:dictionaries requires that much finalizer space as a list.  (That
example is plucked straight from my iTunes Music Library.xml file; I
found this problem while writing some plist code.)

On 1/20/06, felix winkelmann <address@hidden> wrote:
> On 1/18/06, Zbigniew <address@hidden> wrote:

> The current solution is to increase the size of the pending-finalizers
> buffer, done with the "-:fXXX" runtime option. You can also run your
> code with "-:d" to see some information about finalization, or use
> `(set-gc-report! ...)' to see much more information.
>
> A more elegant approach might be to make the pending-buffer
> dynamically resizable - well, it's on my every-growing todo list... ;-)
>
>
> cheers,
> felix
>




reply via email to

[Prev in Thread] Current Thread [Next in Thread]