GithubHelp home page GithubHelp logo

hat-trie's Introduction

Hat-Trie

Build Status

This a ANSI C99 implementation of the HAT-trie data structure of Askitis and Sinha, an extremely efficient (space and time) modern variant of tries.

The version implemented here maps arrays of bytes to words (i.e., unsigned longs), which can be used to store counts, pointers, etc, or not used at all if you simply want to maintain a set of unique strings.

For details see,

  1. Askitis, N., & Sinha, R. (2007). HAT-trie: a cache-conscious trie-based data structure for strings. Proceedings of the thirtieth Australasian conference on Computer science-Volume 62 (pp. 97–105). Australian Computer Society, Inc.

  2. Askitis, N., & Zobel, J. (2005). Cache-conscious collision resolution in string hash tables. String Processing and Information Retrieval (pp. 91–102). Springer.

Installation

git clone [email protected]:dcjones/hat-trie.git
cd hat-trie
autoreconf -i
./configure
make install

To use the library, include hat-trie.h and link using -lhat-trie.

Tests

Build and run the tests:

make check

Other Language Bindings

hat-trie's People

Contributors

b4hand avatar canadaduane avatar cjgibson avatar dcjones avatar kmike avatar luikore avatar mheilman avatar thekvs avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

hat-trie's Issues

License

Please consider adding a license so that people can use your code.

ahtable uses msb or lsb for two-byte length indicator?

I was puzzling over the code this morning and came across this comment:

        /* The most significant bit is set to indicate that two bytes are
         * being used to store the key length. */
        *((uint16_t*) s) = ((uint16_t) len << 1) | 0x1;
        s += 2;

It seems like that is the least significant bit being set, not the most significant, right? If I understand the Intel convention, the LSB (least significant byte) is then packed into the smaller memory address, so the 0x1 will be in the first byte of the 2-byte word. (Just doing a verbal sanity check :)

GCC 10 gives -Wabsolute-value warning on hat-trie.c indicating signedness bug

hat-trie.c: In function ‘hattrie_split’:
hat-trie.c:284:18: warning: taking the absolute value of unsigned type ‘unsigned int’ has no effect [-Wabsolute-value]
  284 |         if (d <= abs(left_m - right_m) && left_m + cs[j + 1] < all_m) {
      |                  ^~~

The expression left_m - right_m likely doesn't work as expected -- it may never be negative because of the unsigned operand types, so the abs has no effect and the operational logic (distance between left_m and right_m) doesn't work.

Merge luikore/hat-trie?

I'm really happy to have found hat-trie and want to give back. However, my use case is one that uses luikore's ruby gem, backed by a modified hat-trie. Rather than give back to just one repository, I wonder if it would be possible to merge his changes back and then discuss possible improvements in documentation and/or readability in code? Related: luikore/triez#4

hattrie_get assert

Under the test case of 1M random keys 1 .. 2048 bytes in length, the len == 0 condition within hattrie_get shall be triggered; the resulting bucket type shall be NODE_TYPE_PURE_BUCKET.

assert(*node.flag & NODE_TYPE_PURE_BUCKET || *node.flag & NODE_TYPE_HYBRID_BUCKET);
assert(len > 0);

Segfault in test suite on various architectures

The latest version (0.1.1) fails some tests with segfaults on various architectures (e.g. ARM, i386, little-endian MIPS, etc.):

make -j1 check VERBOSE=1
make[1]: Entering directory '/«PKGBUILDDIR»'
Making check in src
make[2]: Entering directory '/«PKGBUILDDIR»/src'
make[2]: Nothing to be done for 'check'.
make[2]: Leaving directory '/«PKGBUILDDIR»/src'
Making check in test
make[2]: Entering directory '/«PKGBUILDDIR»/test'
make  check_ahtable check_hattrie bench_sorted_iter
make[3]: Entering directory '/«PKGBUILDDIR»/test'
gcc -DPACKAGE_NAME=\"hat-trie\" -DPACKAGE_TARNAME=\"hat-trie\" -DPACKAGE_VERSION=\"0.1.1\" -DPACKAGE_STRING=\"hat-trie\ 0.1.1\" -DPACKAGE_BUGREPORT=\"[email protected]\" -DPACKAGE_URL=\"\" -DPACKAGE=\"hat-trie\" -DVERSION=\"0.1.1\" -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DHAVE_DLFCN_H=1 -DLT_OBJDIR=\".libs/\" -DHAVE__BOOL=1 -DHAVE_STDBOOL_H=1 -I.  -I../src -Wdate-time -D_FORTIFY_SOURCE=2  -g -O2 -fdebug-prefix-map=/«PKGBUILDDIR»=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -std=gnu99 -Wall -Wextra -pedantic -g -O0 -c -o check_ahtable-check_ahtable.o `test -f 'check_ahtable.c' || echo './'`check_ahtable.c
[...]
gcc -DPACKAGE_NAME=\"hat-trie\" -DPACKAGE_TARNAME=\"hat-trie\" -DPACKAGE_VERSION=\"0.1.1\" -DPACKAGE_STRING=\"hat-trie\ 0.1.1\" -DPACKAGE_BUGREPORT=\"[email protected]\" -DPACKAGE_URL=\"\" -DPACKAGE=\"hat-trie\" -DVERSION=\"0.1.1\" -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DHAVE_DLFCN_H=1 -DLT_OBJDIR=\".libs/\" -DHAVE__BOOL=1 -DHAVE_STDBOOL_H=1 -I.  -I../src -Wdate-time -D_FORTIFY_SOURCE=2  -g -O2 -fdebug-prefix-map=/«PKGBUILDDIR»=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -std=gnu99 -Wall -Wextra -pedantic -g -O0 -c -o check_ahtable-str_map.o `test -f 'str_map.c' || echo './'`str_map.c
/bin/bash ../libtool  --tag=CC   --mode=link gcc  -g -O2 -fdebug-prefix-map=/«PKGBUILDDIR»=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -std=gnu99 -Wall -Wextra -pedantic -g -O0  -Wl,-z,relro -Wl,-z,now -o check_ahtable check_ahtable-check_ahtable.o check_ahtable-str_map.o ../src/libhat-trie.la 
libtool: link: gcc -g -O2 -fdebug-prefix-map=/«PKGBUILDDIR»=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -std=gnu99 -Wall -Wextra -pedantic -g -O0 -Wl,-z -Wl,relro -Wl,-z -Wl,now -o .libs/check_ahtable check_ahtable-check_ahtable.o check_ahtable-str_map.o  ../src/.libs/libhat-trie.so
gcc -DPACKAGE_NAME=\"hat-trie\" -DPACKAGE_TARNAME=\"hat-trie\" -DPACKAGE_VERSION=\"0.1.1\" -DPACKAGE_STRING=\"hat-trie\ 0.1.1\" -DPACKAGE_BUGREPORT=\"[email protected]\" -DPACKAGE_URL=\"\" -DPACKAGE=\"hat-trie\" -DVERSION=\"0.1.1\" -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DHAVE_DLFCN_H=1 -DLT_OBJDIR=\".libs/\" -DHAVE__BOOL=1 -DHAVE_STDBOOL_H=1 -I.  -I../src -Wdate-time -D_FORTIFY_SOURCE=2  -g -O2 -fdebug-prefix-map=/«PKGBUILDDIR»=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -std=gnu99 -Wall -Wextra -pedantic -g -O0 -c -o check_hattrie-check_hattrie.o `test -f 'check_hattrie.c' || echo './'`check_hattrie.c
[...]
gcc -DPACKAGE_NAME=\"hat-trie\" -DPACKAGE_TARNAME=\"hat-trie\" -DPACKAGE_VERSION=\"0.1.1\" -DPACKAGE_STRING=\"hat-trie\ 0.1.1\" -DPACKAGE_BUGREPORT=\"[email protected]\" -DPACKAGE_URL=\"\" -DPACKAGE=\"hat-trie\" -DVERSION=\"0.1.1\" -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DHAVE_DLFCN_H=1 -DLT_OBJDIR=\".libs/\" -DHAVE__BOOL=1 -DHAVE_STDBOOL_H=1 -I.  -I../src -Wdate-time -D_FORTIFY_SOURCE=2  -g -O2 -fdebug-prefix-map=/«PKGBUILDDIR»=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -std=gnu99 -Wall -Wextra -pedantic -g -O0 -c -o check_hattrie-str_map.o `test -f 'str_map.c' || echo './'`str_map.c
/bin/bash ../libtool  --tag=CC   --mode=link gcc  -g -O2 -fdebug-prefix-map=/«PKGBUILDDIR»=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -std=gnu99 -Wall -Wextra -pedantic -g -O0  -Wl,-z,relro -Wl,-z,now -o check_hattrie check_hattrie-check_hattrie.o check_hattrie-str_map.o ../src/libhat-trie.la 
libtool: link: gcc -g -O2 -fdebug-prefix-map=/«PKGBUILDDIR»=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -std=gnu99 -Wall -Wextra -pedantic -g -O0 -Wl,-z -Wl,relro -Wl,-z -Wl,now -o .libs/check_hattrie check_hattrie-check_hattrie.o check_hattrie-str_map.o  ../src/.libs/libhat-trie.so
gcc -DPACKAGE_NAME=\"hat-trie\" -DPACKAGE_TARNAME=\"hat-trie\" -DPACKAGE_VERSION=\"0.1.1\" -DPACKAGE_STRING=\"hat-trie\ 0.1.1\" -DPACKAGE_BUGREPORT=\"[email protected]\" -DPACKAGE_URL=\"\" -DPACKAGE=\"hat-trie\" -DVERSION=\"0.1.1\" -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DHAVE_DLFCN_H=1 -DLT_OBJDIR=\".libs/\" -DHAVE__BOOL=1 -DHAVE_STDBOOL_H=1 -I.  -I../src -Wdate-time -D_FORTIFY_SOURCE=2  -g -O2 -fdebug-prefix-map=/«PKGBUILDDIR»=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -std=gnu99 -Wall -Wextra -pedantic -g -O0 -c -o bench_sorted_iter-bench_sorted_iter.o `test -f 'bench_sorted_iter.c' || echo './'`bench_sorted_iter.c
/bin/bash ../libtool  --tag=CC   --mode=link gcc  -g -O2 -fdebug-prefix-map=/«PKGBUILDDIR»=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -std=gnu99 -Wall -Wextra -pedantic -g -O0  -Wl,-z,relro -Wl,-z,now -o bench_sorted_iter bench_sorted_iter-bench_sorted_iter.o ../src/libhat-trie.la 
libtool: link: gcc -g -O2 -fdebug-prefix-map=/«PKGBUILDDIR»=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -std=gnu99 -Wall -Wextra -pedantic -g -O0 -Wl,-z -Wl,relro -Wl,-z -Wl,now -o .libs/bench_sorted_iter bench_sorted_iter-bench_sorted_iter.o  ../src/.libs/libhat-trie.so
make[3]: Leaving directory '/«PKGBUILDDIR»/test'
make  check-TESTS
make[3]: Entering directory '/«PKGBUILDDIR»/test'
make[4]: Entering directory '/«PKGBUILDDIR»/test'
../test-driver: line 107: 26542 Segmentation fault      "$@" > $log_file 2>&1
FAIL: check_ahtable
PASS: check_hattrie
=========================================
   hat-trie 0.1.1: test/test-suite.log
=========================================

# TOTAL: 2
# PASS:  1
# SKIP:  0
# XFAIL: 0
# FAIL:  1
# XPASS: 0
# ERROR: 0

.. contents:: :depth: 2

FAIL: check_ahtable
===================

generating 100000 keys ... done.
inserting 200000 keys ... 
sizeof: 24244359
done.
iterating through 200000 keys ... 
done.
generating 100000 keys ... done.
inserting 200000 keys ... 
sizeof: 24240563
done.
iterating in order through 200000 keys ... 
done.
generating 100000 keys ... done.
inserting 200000 keys ... 
sizeof: 24287070
done.
saving ahtable ... 
loading ahtable ... 
comparing ahtable ... 
FAIL check_ahtable (exit status: 139)

============================================================================
Testsuite summary for hat-trie 0.1.1
============================================================================
# TOTAL: 2
# PASS:  1
# SKIP:  0
# XFAIL: 0
# FAIL:  1
# XPASS: 0
# ERROR: 0
============================================================================
See test/test-suite.log
Please report to [email protected]
============================================================================

We noticed this while trying to build Debian packages for all platforms targeted by Debian.
Please find the matrix of affected architectures here:
https://buildd.debian.org/status/package.php?p=libhat-trie&suite=experimental
as well as the build status information for the previous version:
https://buildd.debian.org/status/package.php?p=libhat-trie&suite=sid

You can access full build logs for the failed builds by clicking on the build result description (e.g. "Build-Attempted"). Here's an example for little-endian ARM: https://buildd.debian.org/status/fetch.php?pkg=libhat-trie&arch=armel&ver=0.1.1-1&stamp=1493113226&raw=0

How to do ordered iteration?

It seems currently library doesn't support iteration over items in alphabetical order. Am I correct? Are there any plans to implement this? If I understood HAT-Trie properly, there are 2 ways: (a) sort the buckets on insertion and (b) sort the buckets on iteration. What do you think?

autoconf: possibly undefined macros

Following the directions in the README, I ran into this set of errors:

configure.ac:3: error: possibly undefined macro: AM_INIT_AUTOMAKE
      If this token and others are legitimate, please use m4_pattern_allow.
      See the Autoconf documentation.
configure.ac:26: error: possibly undefined macro: AC_DISABLE_SHARED
configure.ac:27: error: possibly undefined macro: AC_PROG_LIBTOOL

I was able to satisfy autoconf by running libtoolize:

> libtoolize 
libtoolize: putting auxiliary files in `.'.
libtoolize: linking file `./ltmain.sh'
libtoolize: putting macros in AC_CONFIG_MACRO_DIR, `m4'.
libtoolize: linking file `m4/libtool.m4'
libtoolize: linking file `m4/ltoptions.m4'
libtoolize: linking file `m4/ltsugar.m4'
libtoolize: linking file `m4/ltversion.m4'
libtoolize: linking file `m4/lt~obsolete.m4'

Would you prefer a PR with those files committed or with that step added to the directions in the README?

Missing function hattrie_dup

The function hattrie_dup is defined in the header, but there's no code to implement it.

Should the function be removed from the header?

GCC 12 gives -Wimplicit-fallthrough because of -Wextra

Either you should remove -Wextra or add the __attribute__ ((fallthrough)) to suppress it.

murmurhash3.c: In function ‘hash’:
murmurhash3.c:62:20: warning: this statement may fall through [-Wimplicit-fallthrough=]
   62 |         case 3: k1 ^= tail[2] << 16;
      |                 ~~~^~~~~~~~~~~~~~~~
murmurhash3.c:63:9: note: here
   63 |         case 2: k1 ^= tail[1] << 8;
      |         ^~~~
murmurhash3.c:63:20: warning: this statement may fall through [-Wimplicit-fallthrough=]
   63 |         case 2: k1 ^= tail[1] << 8;
      |                 ~~~^~~~~~~~~~~~~~~
murmurhash3.c:64:9: note: here
   64 |         case 1: k1 ^= tail[0];
      |         ^~~~

gcc address-sanitiser warnings

I patched hat-trie-master/configure.ac to enable gcc address sanitiser:

cat > hat-trie-master.patch << 'EOF'
--- hat-trie-master/configure.ac	2018-12-06 11:36:58.000000000 +1100
+++ hat-trie-master-new/configure.ac	2022-11-12 22:28:50.565755292 +1100
@@ -6,7 +6,8 @@
 
 base_CFLAGS="-std=gnu99 -Wall -Wextra -pedantic"
 opt_CFLAGS="${base_CFLAGS} -O3"
-dbg_CFLAGS="${base_CFLAGS} -g -O0"
+dbg_CFLAGS="${base_CFLAGS} -ggdb3 -O0 -ggdb3 -fsanitize=undefined -fsanitize=address -fno-sanitize=vptr -fno-omit-frame-pointer"
+
 
 AC_ARG_ENABLE([debugging],
               [AS_HELP_STRING([--enable-debugging],
 
EOF
unzip hat-trie-master.zip
cd hat-trie-master
patch -p1 < ../hat-trie-master.patch
export LDFLAGS="-ggdb3 -O0 -ggdb3 -fsanitize=undefined -fsanitize=address \
-fno-sanitize=vptr -fno-omit-frame-pointer"
autoreconf -i
./configure --enable-debugging
make
cd test

make check_hattrie
./check_hattrie  > check_hattrie.log 2>&1

check_hattrie.log shows address alignment warnings:
check_hattrie.log

Running valgrind ./check_hattrie on a release build shows no errors or warnings.

I am running Fedora-36 6.0.7-200.fc36.x86_64 GNU/Linux
and gcc version 12.2.1 20220819 (Red Hat 12.2.1-2) (GCC)

Building / Common.h

autoconf and automake both fail for me -- am I missing something?

Also, I'm not seeing common.h -- is it hiding somewhere?

Porting hat-trie to C++

Hello,

For my personal usage, I want to implement a C++ version of your library using smart pointers and stuff. Will this alter the efficiency of this algorithm?

keys longer than 32767 bytes cause undefined behaviour

Passing in keys longer than 32767 bytes causes all kind of undefined behaviour (e.g. segfault) when iterating over the hat-trie later.

Valgrind indicates the following:

==20614== Memcheck, a memory error detector
==20614== Copyright (C) 2002-2015, and GNU GPL'd, by Julian Seward et al.
==20614== Using Valgrind-3.11.0 and LibVEX; rerun with -h for copyright info
==20614== Command: ./mkhatlex
==20614==
len=32768==20614== Invalid write of size 8
==20614== at 0x4E3996D: ahtable_sorted_iter_begin (ahtable.c:352)
==20614== by 0x4E3996D: ahtable_iter_begin (ahtable.c:523)
==20614== by 0x4E3A346: hattrie_iter_nextnode (hat-trie.c:576)
==20614== by 0x4E3AF9B: hattrie_iter_begin (hat-trie.c:605)
==20614== by 0x400BD3: main (mkhatlex.c:51)
==20614== Address 0x542b688 is 0 bytes after a block of size 8 alloc'd
==20614== at 0x4C2BBAD: malloc (vg_replace_malloc.c:299)
==20614== by 0x4E3B2A8: malloc_or_die (misc.c:14)
==20614== by 0x4E398F2: ahtable_sorted_iter_begin (ahtable.c:344)
==20614== by 0x4E398F2: ahtable_iter_begin (ahtable.c:523)
==20614== by 0x4E3A346: hattrie_iter_nextnode (hat-trie.c:576)
==20614== by 0x4E3AF9B: hattrie_iter_begin (hat-trie.c:605)
==20614== by 0x400BD3: main (mkhatlex.c:51)
==20614==
==20614==
==20614== HEAP SUMMARY:
==20614== in use at exit: 0 bytes in 0 blocks
==20614== total heap usage: 25 allocs, 25 frees, 180,257 bytes allocated
==20614==
==20614== All heap blocks were freed -- no leaks are possible
==20614==
==20614== For counts of detected and suppressed errors, rerun with: -v
==20614== ERROR SUMMARY: 3 errors from 1 contexts (suppressed: 0 from 0)

I can prepare a minimum working example but this should be really easy to reproduce.

Please do not use config.h

It is imported in ahtable.c. This causes issues because user of library have to use GNU build tools in order to generate this file from config.h.in and it makes it harder to use the library under Windows or to bundle it in a scripting language extension. I'm writing a Python wrapper for your library ( https://github.com/kmike/hat-trie ) and it is hard to make the code build with distutils because setup script have to generate config.h somehow. So config.h is just commented out in the bundled version.

If my understanding is correct, config.h import from ahtable.c is used for size_t, uint16_t, uint32_t and uint8_t if they are not available in <sys/types.h> and <sys/stdint.h>. Library builds under Mac OS if config.h import is just removed from ahtable.c because these int types are usually defined on *nix.

The library won't build under MSVC 2008 anyway because MSVC 2008 doesn't have stdint.h header :)

I think the best way to go forward is to remove config.h import, stdint.h imports and replace them with some portable stint.h header (such as http://www.azillionmonkeys.com/qed/pstdint.h )

What do you think?

By the way, thanks for the nice C implementation!

How would you feel about adding support for partial iteration?

It would be nice to begin iteration from an arbitrary point in the trie.

I notice the current iterator setup is slightly involved due to the parent pointer stack, but it would be nice to be able to construct this with an initial value offset.

It seems like this would not be a large addition, but I was curious how you would feel about the change and whether you think it would be an acceptable change?

Doesn't compile on Windows64

I am getting this error (while trying to install a Python package that uses this project):
c:\users\tadas\appdata\local\temp\pip_build_tadas\hat-trie\src../hat-trie/src/hat-trie.h(27) : fatal error C1083: Cannot open include file: 'stdbool.h': No such file or directory

error: command '"C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\Bin\amd64\cl.exe"' failed with exit status 2

The quick fix seems to be to replace stdbool with:

typedef int bool;

define false 0

define true 1

http://stackoverflow.com/questions/8548521/trying-to-use-include-stdbool-h-in-vs-2010

Value-less trie

It would be nice to be able to support a pure trie that has no additional value besides the key itself.

This change seems like it would be a bit invasive, and I'm not sure how to achieve it without inducing some code duplication, but I was curious if you had any strong objections to this feature?

Please tag a released version

Hi, I am looking to package this for Debian as a dependency of another software. To make it possible for me to uniquely reference the packaged version, I am kindly asking that you provide versioned tags for hat-trie in this GitHub repository? Thanks in advance!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.