Fast, immutable string interning for C.
$ cmake -G 'Unix Makefiles' -Wno-dev [OPTIONS]
$ make install
Options are:
-DBUILD_STATIC=1
: Build a static library (libintern.a
) rather than a shared
library (libintern.so
or libintern.dylib
)-DMMAP_PAGES=1
: Allocate pages with mmap(2)
rather than malloc(3)
-DPAGE_SIZE=4096
: Set the page size-DINLINE_UNSIGNED=1
: Inline unsigned integers between 0 and INT_MAX
-DCMAKE_BUILD_TYPE=Release
: Do a release build / enable optimizationBuild your project with -lintern
and include <intern/strings.h>
.
See strings.h and optimize.h for more details.
MIT