Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

[PATCH] 2 modules, zsh/db, zsh/gdbm, bug-fixes



Hello
1. New module `zsh/db` that provides good architecture, via `*_main_entry` functions in client modules (zsh/db/gdbm in this patch).

2. Also, `zdb_backends` hash holding e.g. "db/gdbm" -> "loaded". 

These are according to Bart opinion. Amount of builtins is normal, small (ztie, zuntie, etc). Also, zsh/db behaves as a library of common functions.

When developing zredis, with intensive Valgrind use, I've found and fixed following bugs in zsh/gdbm:

- no deletehashtable() in custom hash-set-fn,

- no emptyhashtable() in custom hash-set-fn – replacing hash with tied_param=( k v ) caused addition of k -> v, and left untouched previous Param content,

- call to *untie function to remove PM_READONLY flag caused memory leak, the flag is now removed directly, if user gave -u option to untie,

- data returned by libgdbm should be free()-d (e.g. key returned by gdbm_nextkey),

- freeparamnode() had if(delunset) condition, this caused memory leak – replaced with myfreeparamnode().

Tested on: OS X, Freebsd, Gentoo, Ubuntu.

Next step would be zredis.

--  
Sebastian Gniazdowski
psprint /at/ zdharma.org

Attachment: db_gdbm_2_modules.diff
Description: Binary data



Messages sorted by: Reverse Date, Date, Thread, Author