chicken-users
[Top][All Lists]
Advanced

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

Re: [Chicken-users] gdbm.egg patch


From: felix winkelmann
Subject: Re: [Chicken-users] gdbm.egg patch
Date: Wed, 13 Jul 2005 23:29:01 +0200

On 7/5/05, Daishi Kato <address@hidden> wrote:
> Hi,
> 
> As looking into the gdbm egg, I noticed the limitation
> that it can only handle strings without any zeros in the middle,
> in other words, "c-string"s.
> Attached file is the patch for it,
> although the function "make_string_with_len" is not nice.
> I'm not sure if it works correctly,
> since I'm not familiar with the GC stuff.
> I believe there should be some kind of low-level function
> doing the similar thing, which can improve this patch.
> 

Many thanks for your patch. I've optimized the string-construction
procedure a little (the way you handle this is correct, there is currently
no way of heap-allocating storage from the GC'd heap without
doing a callback), and replaced some foreign-lambda forms with
foreign-safe-lambda (otherwise really weird crashes happen when
you call back the string-constructor). I also checked out the gdbm
manpages and they require to free(3) the results of `gdbm_fetch', etc.
I've attached the new version. I plan to release a new chicken version
soon, and since many things have changed, the improved gdbm egg
will be made publicly available at the same time (but this one should
work fine with the current chicken). 


cheers,
felix

Attachment: gdbm.scm
Description: Binary data


reply via email to

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