Permalink
Please sign in to comment.
Browse files
Merge pull request #55 from wltrimbl/updatesparsehash
Updates sparsehash to 2.0.3 dating from 2015-10-12
- Loading branch information...
Showing
with
4,075 additions
and 1,174 deletions.
- +4 −4 clipper/Makefile
- 0 clipper/{sparsehash-2.0.2 → sparsehash-2.0.3}/AUTHORS
- 0 clipper/{sparsehash-2.0.2 → sparsehash-2.0.3}/COPYING
- +5 −0 clipper/{sparsehash-2.0.2 → sparsehash-2.0.3}/ChangeLog
- 0 clipper/{sparsehash-2.0.2 → sparsehash-2.0.3}/INSTALL
- 0 clipper/{sparsehash-2.0.2 → sparsehash-2.0.3}/Makefile.am
- 0 clipper/{sparsehash-2.0.2 → sparsehash-2.0.3}/Makefile.in
- +6 −1 clipper/{sparsehash-2.0.2 → sparsehash-2.0.3}/NEWS
- 0 clipper/{sparsehash-2.0.2 → sparsehash-2.0.3}/README
- +25 −25 clipper/{sparsehash-2.0.2 → sparsehash-2.0.3}/README_windows.txt
- 0 clipper/{sparsehash-2.0.2 → sparsehash-2.0.3}/TODO
- 0 clipper/{sparsehash-2.0.2 → sparsehash-2.0.3}/aclocal.m4
- +23 −0 clipper/sparsehash-2.0.3/autogen.sh
- 0 clipper/{sparsehash-2.0.2 → sparsehash-2.0.3}/config.guess
- 0 clipper/{sparsehash-2.0.2 → sparsehash-2.0.3}/config.sub
- 0 clipper/{sparsehash-2.0.2 → sparsehash-2.0.3}/configure
- 0 clipper/{sparsehash-2.0.2 → sparsehash-2.0.3}/configure.ac
- 0 clipper/{sparsehash-2.0.2 → sparsehash-2.0.3}/depcomp
- 0 clipper/{sparsehash-2.0.2 → sparsehash-2.0.3}/doc/dense_hash_map.html
- 0 clipper/{sparsehash-2.0.2 → sparsehash-2.0.3}/doc/dense_hash_set.html
- 0 clipper/{sparsehash-2.0.2 → sparsehash-2.0.3}/doc/designstyle.css
- 0 clipper/{sparsehash-2.0.2 → sparsehash-2.0.3}/doc/implementation.html
- 0 clipper/{sparsehash-2.0.2 → sparsehash-2.0.3}/doc/index.html
- 0 clipper/{sparsehash-2.0.2 → sparsehash-2.0.3}/doc/performance.html
- 0 clipper/{sparsehash-2.0.2 → sparsehash-2.0.3}/doc/sparse_hash_map.html
- 0 clipper/{sparsehash-2.0.2 → sparsehash-2.0.3}/doc/sparse_hash_set.html
- 0 clipper/{sparsehash-2.0.2 → sparsehash-2.0.3}/doc/sparsetable.html
- +9 −0 clipper/sparsehash-2.0.3/experimental/Makefile
- +14 −0 clipper/sparsehash-2.0.3/experimental/README
- +55 −0 clipper/sparsehash-2.0.3/experimental/example.c
- +1,538 −0 clipper/sparsehash-2.0.3/experimental/libchash.c
- +253 −0 clipper/sparsehash-2.0.3/experimental/libchash.h
- +71 −0 clipper/sparsehash-2.0.3/google-sparsehash.sln
- 0 clipper/{sparsehash-2.0.2 → sparsehash-2.0.3}/install-sh
- 0 clipper/{sparsehash-2.0.2 → sparsehash-2.0.3}/m4/acx_pthread.m4
- 0 clipper/{sparsehash-2.0.2 → sparsehash-2.0.3}/m4/google_namespace.m4
- 0 clipper/{sparsehash-2.0.2 → sparsehash-2.0.3}/m4/namespaces.m4
- 0 clipper/{sparsehash-2.0.2 → sparsehash-2.0.3}/m4/stl_hash.m4
- 0 clipper/{sparsehash-2.0.2 → sparsehash-2.0.3}/m4/stl_hash_fun.m4
- 0 clipper/{sparsehash-2.0.2 → sparsehash-2.0.3}/missing
- 0 clipper/{sparsehash-2.0.2 → sparsehash-2.0.3}/packages/deb.sh
- +7 −0 clipper/sparsehash-2.0.3/packages/deb/README
- +173 −0 clipper/sparsehash-2.0.3/packages/deb/changelog
- +1 −0 clipper/sparsehash-2.0.3/packages/deb/compat
- +17 −0 clipper/sparsehash-2.0.3/packages/deb/control
- +36 −0 clipper/sparsehash-2.0.3/packages/deb/copyright
- +16 −0 clipper/sparsehash-2.0.3/packages/deb/docs
- +117 −0 clipper/sparsehash-2.0.3/packages/deb/rules
- +5 −0 clipper/sparsehash-2.0.3/packages/deb/sparsehash.dirs
- +6 −0 clipper/sparsehash-2.0.3/packages/deb/sparsehash.install
- 0 clipper/{sparsehash-2.0.2 → sparsehash-2.0.3}/packages/rpm.sh
- 0 clipper/{sparsehash-2.0.2 → sparsehash-2.0.3}/packages/rpm/rpm.spec
- +63 −63 clipper/{sparsehash-2.0.2 → sparsehash-2.0.3}/sparsehash.sln
- 0 clipper/{sparsehash-2.0.2 → sparsehash-2.0.3}/src/config.h.in
- 0 clipper/{sparsehash-2.0.2 → sparsehash-2.0.3}/src/config.h.include
- 0 clipper/{sparsehash-2.0.2 → sparsehash-2.0.3}/src/google/dense_hash_map
- 0 clipper/{sparsehash-2.0.2 → sparsehash-2.0.3}/src/google/dense_hash_set
- 0 clipper/{sparsehash-2.0.2 → sparsehash-2.0.3}/src/google/sparse_hash_map
- 0 clipper/{sparsehash-2.0.2 → sparsehash-2.0.3}/src/google/sparse_hash_set
- 0 clipper/{sparsehash-2.0.2 → sparsehash-2.0.3}/src/google/sparsehash/densehashtable.h
- 0 clipper/{sparsehash-2.0.2 → sparsehash-2.0.3}/src/google/sparsehash/hashtable-common.h
- 0 clipper/{sparsehash-2.0.2 → sparsehash-2.0.3}/src/google/sparsehash/libc_allocator_with_realloc.h
- 0 clipper/{sparsehash-2.0.2 → sparsehash-2.0.3}/src/google/sparsehash/sparsehashtable.h
- 0 clipper/{sparsehash-2.0.2 → sparsehash-2.0.3}/src/google/sparsetable
- 0 clipper/{sparsehash-2.0.2 → sparsehash-2.0.3}/src/google/template_util.h
- 0 clipper/{sparsehash-2.0.2 → sparsehash-2.0.3}/src/google/type_traits.h
- +3 −3 clipper/{sparsehash-2.0.2 → sparsehash-2.0.3}/src/hash_test_interface.h
- +3 −3 clipper/{sparsehash-2.0.2 → sparsehash-2.0.3}/src/hashtable_test.cc
- 0 clipper/{sparsehash-2.0.2 → sparsehash-2.0.3}/src/libc_allocator_with_realloc_test.cc
- 0 clipper/{sparsehash-2.0.2 → sparsehash-2.0.3}/src/simple_compat_test.cc
- 0 clipper/{sparsehash-2.0.2 → sparsehash-2.0.3}/src/simple_test.cc
- 0 clipper/{sparsehash-2.0.2 → sparsehash-2.0.3}/src/sparsehash/dense_hash_map
- 0 clipper/{sparsehash-2.0.2 → sparsehash-2.0.3}/src/sparsehash/dense_hash_set
- 0 clipper/{sparsehash-2.0.2 → sparsehash-2.0.3}/src/sparsehash/internal/densehashtable.h
- +1 −1 clipper/{sparsehash-2.0.2 → sparsehash-2.0.3}/src/sparsehash/internal/hashtable-common.h
- 0 clipper/{sparsehash-2.0.2 → sparsehash-2.0.3}/src/sparsehash/internal/libc_allocator_with_realloc.h
- +3 −3 clipper/{sparsehash-2.0.2 → sparsehash-2.0.3}/src/sparsehash/internal/sparsehashtable.h
- 0 clipper/{sparsehash-2.0.2 → sparsehash-2.0.3}/src/sparsehash/sparse_hash_map
- 0 clipper/{sparsehash-2.0.2 → sparsehash-2.0.3}/src/sparsehash/sparse_hash_set
- 0 clipper/{sparsehash-2.0.2 → sparsehash-2.0.3}/src/sparsehash/sparsetable
- 0 clipper/{sparsehash-2.0.2 → sparsehash-2.0.3}/src/sparsehash/template_util.h
- 0 clipper/{sparsehash-2.0.2 → sparsehash-2.0.3}/src/sparsehash/type_traits.h
- 0 clipper/{sparsehash-2.0.2 → sparsehash-2.0.3}/src/sparsetable_unittest.cc
- 0 clipper/{sparsehash-2.0.2 → sparsehash-2.0.3}/src/template_util_unittest.cc
- 0 clipper/{sparsehash-2.0.2 → sparsehash-2.0.3}/src/testutil.h
- 0 clipper/{sparsehash-2.0.2 → sparsehash-2.0.3}/src/time_hash_map.cc
- 0 clipper/{sparsehash-2.0.2 → sparsehash-2.0.3}/src/type_traits_unittest.cc
- +149 −0 clipper/sparsehash-2.0.3/src/windows/config.h
- +49 −0 clipper/sparsehash-2.0.3/src/windows/google/sparsehash/sparseconfig.h
- +64 −0 clipper/sparsehash-2.0.3/src/windows/port.cc
- +72 −0 clipper/sparsehash-2.0.3/src/windows/port.h
- +49 −0 clipper/sparsehash-2.0.3/src/windows/sparsehash/internal/sparseconfig.h
- +197 −197 clipper/{sparsehash-2.0.2 → sparsehash-2.0.3}/vsprojects/hashtable_test/hashtable_test.vcproj
- +161 −161 ...sehash-2.0.3}/vsprojects/libc_allocator_with_realloc_test/libc_allocator_with_realloc_test.vcproj
- +188 −188 clipper/{sparsehash-2.0.2 → sparsehash-2.0.3}/vsprojects/simple_test/simple_test.vcproj
- +170 −170 ...{sparsehash-2.0.2 → sparsehash-2.0.3}/vsprojects/sparsetable_unittest/sparsetable_unittest.vcproj
- +167 −0 clipper/sparsehash-2.0.3/vsprojects/template_util_unittest/template_util_unittest.vcproj
- +188 −188 clipper/{sparsehash-2.0.2 → sparsehash-2.0.3}/vsprojects/time_hash_map/time_hash_map.vcproj
- +167 −167 ...{sparsehash-2.0.2 → sparsehash-2.0.3}/vsprojects/type_traits_unittest/type_traits_unittest.vcproj
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
| @@ -1,25 +1,25 @@ | ||
| -This project has been ported to Windows. A working solution file | ||
| -exists in this directory: | ||
| - sparsehash.sln | ||
| - | ||
| -You can load this solution file into either VC++ 7.1 (Visual Studio | ||
| -2003) or VC++ 8.0 (Visual Studio 2005) -- in the latter case, it will | ||
| -automatically convert the files to the latest format for you. | ||
| - | ||
| -When you build the solution, it will create a number of | ||
| -unittests,which you can run by hand (or, more easily, under the Visual | ||
| -Studio debugger) to make sure everything is working properly on your | ||
| -system. The binaries will end up in a directory called "debug" or | ||
| -"release" in the top-level directory (next to the .sln file). | ||
| - | ||
| -Note that these systems are set to build in Debug mode by default. | ||
| -You may want to change them to Release mode. | ||
| - | ||
| -I have little experience with Windows programming, so there may be | ||
| -better ways to set this up than I've done! If you run across any | ||
| -problems, please post to the google-sparsehash Google Group, or report | ||
| -them on the sparsehash Google Code site: | ||
| - http://groups.google.com/group/google-sparsehash | ||
| - http://code.google.com/p/sparsehash/issues/list | ||
| - | ||
| --- craig | ||
| +This project has been ported to Windows. A working solution file | ||
| +exists in this directory: | ||
| + sparsehash.sln | ||
| + | ||
| +You can load this solution file into either VC++ 7.1 (Visual Studio | ||
| +2003) or VC++ 8.0 (Visual Studio 2005) -- in the latter case, it will | ||
| +automatically convert the files to the latest format for you. | ||
| + | ||
| +When you build the solution, it will create a number of | ||
| +unittests,which you can run by hand (or, more easily, under the Visual | ||
| +Studio debugger) to make sure everything is working properly on your | ||
| +system. The binaries will end up in a directory called "debug" or | ||
| +"release" in the top-level directory (next to the .sln file). | ||
| + | ||
| +Note that these systems are set to build in Debug mode by default. | ||
| +You may want to change them to Release mode. | ||
| + | ||
| +I have little experience with Windows programming, so there may be | ||
| +better ways to set this up than I've done! If you run across any | ||
| +problems, please post to the google-sparsehash Google Group, or report | ||
| +them on the sparsehash Google Code site: | ||
| + http://groups.google.com/group/google-sparsehash | ||
| + http://code.google.com/p/sparsehash/issues/list | ||
| + | ||
| +-- craig |
File renamed without changes.
File renamed without changes.
| @@ -0,0 +1,23 @@ | ||
| +#!/bin/sh | ||
| + | ||
| +# Before using, you should figure out all the .m4 macros that your | ||
| +# configure.m4 script needs and make sure they exist in the m4/ | ||
| +# directory. | ||
| +# | ||
| +# These are the files that this script might edit: | ||
| +# aclocal.m4 configure Makefile.in src/config.h.in \ | ||
| +# compile config.guess config.sub depcomp install-sh missing mkinstalldirs | ||
| +# | ||
| +# Here's a command you can run to see what files aclocal will import: | ||
| +# aclocal -I ../autoconf --output=- | sed -n 's/^m4_include..\([^]]*\).*/\1/p' | ||
| + | ||
| +set -ex | ||
| +rm -rf autom4te.cache | ||
| + | ||
| +aclocal --force -I m4 | ||
| +autoconf -f -W all,no-obsolete | ||
| +autoheader -f -W all | ||
| +automake -a -c -f -W all | ||
| + | ||
| +rm -rf autom4te.cache | ||
| +exit 0 |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
| @@ -0,0 +1,9 @@ | ||
| +example: example.o libchash.o | ||
| + $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $^ | ||
| + | ||
| +.SUFFIXES: .c .o .h | ||
| +.c.o: | ||
| + $(CC) -c $(CPPFLAGS) $(CFLAGS) -o $@ $< | ||
| + | ||
| +example.o: example.c libchash.h | ||
| +libchash.o: libchash.c libchash.h |
| @@ -0,0 +1,14 @@ | ||
| +This is a C version of sparsehash (and also, maybe, densehash) that I | ||
| +wrote way back when, and served as the inspiration for the C++ | ||
| +version. The API for the C version is much uglier than the C++, | ||
| +because of the lack of template support. I believe the class works, | ||
| +but I'm not convinced it's really flexible or easy enough to use. | ||
| + | ||
| +It would be nice to rework this C class to follow the C++ API as | ||
| +closely as possible (eg have a set_deleted_key() instead of using a | ||
| +#define like this code does now). I believe the code compiles and | ||
| +runs, if anybody is interested in using it now, but it's subject to | ||
| +major change in the future, as people work on it. | ||
| + | ||
| +Craig Silverstein | ||
| +20 March 2005 |
| @@ -0,0 +1,55 @@ | ||
| +#include <sparsehash/internal/sparseconfig.h> | ||
| +#include <stdlib.h> | ||
| +#include <stdio.h> | ||
| +#include <assert.h> | ||
| +#include "libchash.h" | ||
| + | ||
| +static void TestInsert() { | ||
| + struct HashTable* ht; | ||
| + HTItem* bck; | ||
| + | ||
| + ht = AllocateHashTable(1, 0); /* value is 1 byte, 0: don't copy keys */ | ||
| + | ||
| + HashInsert(ht, PTR_KEY(ht, "January"), 31); /* 0: don't overwrite old val */ | ||
| + bck = HashInsert(ht, PTR_KEY(ht, "February"), 28); | ||
| + bck = HashInsert(ht, PTR_KEY(ht, "March"), 31); | ||
| + | ||
| + bck = HashFind(ht, PTR_KEY(ht, "February")); | ||
| + assert(bck); | ||
| + assert(bck->data == 28); | ||
| + | ||
| + FreeHashTable(ht); | ||
| +} | ||
| + | ||
| +static void TestFindOrInsert() { | ||
| + struct HashTable* ht; | ||
| + int i; | ||
| + int iterations = 1000000; | ||
| + int range = 30; /* random number between 1 and 30 */ | ||
| + | ||
| + ht = AllocateHashTable(4, 0); /* value is 4 bytes, 0: don't copy keys */ | ||
| + | ||
| + /* We'll test how good rand() is as a random number generator */ | ||
| + for (i = 0; i < iterations; ++i) { | ||
| + int key = rand() % range; | ||
| + HTItem* bck = HashFindOrInsert(ht, key, 0); /* initialize to 0 */ | ||
| + bck->data++; /* found one more of them */ | ||
| + } | ||
| + | ||
| + for (i = 0; i < range; ++i) { | ||
| + HTItem* bck = HashFind(ht, i); | ||
| + if (bck) { | ||
| + printf("%3d: %d\n", bck->key, bck->data); | ||
| + } else { | ||
| + printf("%3d: 0\n", i); | ||
| + } | ||
| + } | ||
| + | ||
| + FreeHashTable(ht); | ||
| +} | ||
| + | ||
| +int main(int argc, char** argv) { | ||
| + TestInsert(); | ||
| + TestFindOrInsert(); | ||
| + return 0; | ||
| +} |
Oops, something went wrong.
0 comments on commit
ae1bb52