Filed under: Software updates
uthash v1.8 has been released. This introduces a few new features including a Bloom filter, a new live analysis utility for Linux called hashscan, the re-inclusion of the MurmurHash, and a couple of bug fixes for the companion linked list header, utlist.
Version 1.8 (2009-09-08)
- Added the hashscan utility that can report on the size and quality of hash tables in a running process (Linux-only)
- Added Bloom filter support. This has the potential to speed up certain types of programs that look up non-existant keys in sufficient numbers.
- Restored the MurmurHash, which can once again be used, if an additional symbol is defined. This is a “safety” by which the user declares they understand that -fno-strict-aliasing flag must be used if they are using MurmurHash under gcc with optimization.
- Unified the bucket/table malloc hooks; now there is only one malloc hook
- Re-organized the manual into a main section and advanced topics section
- Fixed a bug in utlist.h where sorting a singly-linked list threw a compile-time error.
- Fixed a bug in utlist.h where a doubly-linked list that is sorted did not maintain the special head→prev pointer back to the list tail.
Filed under: Software updates
Today I’ve released uthash v1.7. This is a maintenance release.
Version 1.7 (2009-06-11)
- The MurmurHash has been removed, and Jenkin’s hash is once again the default. While MurmurHash performed well, it’s unsafe with regard to the strict aliasing rule. This results in incorrect code when compiled with optimization. It’s not possible to apply -fno-strict-aliasing from within a header file.
- The linked list macros in utlist.h now comply with the strict-aliasing rule so they generate correct code under high optimization levels (O2 or O3). The use of the typeof extension, which was originally a GNU extension, may reduce portability to other compilers that do not support this extension. This extension is used in the singly-linked list macros and the sort macros.
Filed under: technotes
Every now and then I need to remind myself how naming and versioning work with dynamic libraries. First, their version numbers are entirely distinct from the package that contains them. In other words, tpl v1.4 is a package version, but the library it installs may be libtpl.so.0. The library name reflects its ABI (interface) version.
It can be helpful to understand why there are apparently several versions of a shared library in a directory. Let’s take a look at a fictitious libjunk and its associated files as we might see on Linux system in /usr/lib:
|
libjunk.so.5.1.1
|
“real name”
|
|
libjunk.so.5
|
“soname”
|
|
libjunk.so
|
“linker name”
|
- The real name
- This refers to the “real” library file produced by the C compiler (libjunk.so.5.1.1). The naming convention is .so.INTERFACE.MINOR[.RELEASE].
- The “soname”
- ldconfig made this file (libjunk.so.5) as a symlink to the real file. It made the filename from the soname stored inside the real library (objdump –p libjunk.so.5.1.1 | grep SONAME). This soname was fixed at compilation time (gcc –shared –Wl,-soname,libjunk.so.5) –o libjunk.so.5.1.1 junk.c). This soname is recorded in binaries that depend on it, as can be seen using ldd.
- The “linker name”
- This file (libjunk.so) is used only for compiling and linking programs against the shared library. This is what the linker looks for when you specify –ljunk. It may just be a symlink to the soname. The newly linked object will record a dependency on the soname, not the real name. This permits new ABI-compatible versions of the library to be installed and used to satisfy the soname dependency.
The “soname” only needs to change when the library interface (ABI) changes in an incompatible way. Otherwise the soname can be left alone. New minor versions of the library can be installed and ldconfig will symlink the soname to the new minor version.
Setting the version under libtool
In tpl, the version numbers are passed to libtool via this line in Makefile.am:
libtpl_la_LDFLAGS = -no-undefined -version-info 1:0:0
The version string (1:0:0) is documented as current[:revision[:age]]. Only current is required and it is what we call INTERFACE version above.
Related links
Filed under: Software updates
Today I’ve released uthash v1.6. Here is the ChangeLog:
Version 1.6 (2009-05-08)
Special thanks to Alfred Heisner for contributing several enhancements:
- Support for two new hash functions:
- the Paul Hsieh hash function (HASH_SFH)
- Austin Appleby’s MurmurHash function (HASH_MUR)
- Because of its excellent performance, MurmurHash is now the default hash function.
- keystats now has much better elapsed time accuracy under Cygwin and MinGW
- fixed casting in HASH_FNV, HASH_SAX and HASH_OAT for non-char keys
This release also includes:
- a new HASH_CLEAR operation clears a hash table in one step.
- a new HASH_SELECT operation inserts those elements from one hash that satisfy a given condition into another hash. The selected items have dual presence in both hash tables. For example a game could select the visible polygons from a hash of all polygons.
- fixed a compile-time error which occurred if the final argument to HASH_ADD_KEYPTR was a pointer to an array member like &a[i]
- added another test script tests/all_funcs which executes the test suite using every supported hash function
And lastly,
- a new, separate header called utlist.h is included which provides linked list macros for C structures, similar in style to the uthash macros
Filed under: Software updates
Today I’ve released tpl v1.4.
This release has several small enhancements to fixed-length array support, as well as support for nested structures and for caller-supplied buffers for dump and load. This is the full list of changes:
Version 1.4 (2009-04-25)
- fixed-length arrays can now be multi-dimensional like i##
- fixed-length string arrays like s# are now supported
- nested structures can now be expressed, using the dollar symbol, e.g. S(ci$(cc))
- tpl_dump can use a caller-allocated output buffer (TPL_MEM|TPL_PREALLOCD)
- tpl_load can tolerate excess space in input buffer (TPL_MEM|TPL_EXCESS_OK)
- implement TPL_FXLENS flag for tpl_peek to get lengths of fixed-length arrays
- implement TPL_GETSIZE flag for tpl_dump to get dump size without dumping
- fix success return code from tpl_dump(TPL_FD,…) (thanks, Max Lapan!)
- deprecated the wildcard unpacking S(*) feature
Filed under: Software updates
Today I’ve released uthash v1.5.
This release makes uthash thread-safe for concurrent readers. Thanks to Peter Arvidsson for suggesting the change that made this possible. As a side benefit, HASH_FIND is now faster– around 13% on some of my tests.
Version 1.5 (2009-02-19)
- now thread-safe for concurrent readers
- use scratch variables on stack rather than in table (thanks, Petter Arvidsson!). This change made HASH_FIND about 13% faster and enabled reader concurrency.
- made BSD license terms even more permissive
- added PDF version of User Guide
- added update news
Filed under: Software updates
Today I’ve released tpl v1.3.
The complete list of changes follows.
Version 1.3 (2009-02-10)
- added PDF version of the User Guide
- added TPL_DATAPEEK mode for tpl_peek
- added support for NULL strings
- added support for 16-bit integer types (j,v)
- added tpl_jot
- added support for fixed-length arrays of structures S(…)#
- added support for pre-C99 compilers (thanks, Wei Wei!)
- improved structure alignment calculation (thanks, Wu Yongwei!)
- added RPM spec file (thanks, Alessandro Ren!)
- compiles cleanly with -Wall and -pedantic and with -O3
- made BSD license terms even more permissive
- test suite: exit with status zero when all tests pass
- added update news
- added tpl wiki
The combination of AsciiDoc and dblatex did a nice job of the PDF rendering.
Thanks to everyone who has contributed to tpl and helped test the new features.
Filed under: Software updates
I’ve created this blog as a news feed for announcing updates to my open source packages:
I’m pleased to be using blogpost by Stuart Rackham, another great tool in the AsciiDoc family. AsciiDoc is also used to create the User Guides (both PDF and HTML versions) for uthash and tpl.
