On 7/5/05, Daishi Kato <[EMAIL PROTECTED]> 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
gdbm.scm
Description: Binary data
_______________________________________________ Chicken-users mailing list [email protected] http://lists.nongnu.org/mailman/listinfo/chicken-users
