diff --git a/fake_pyrex/Pyrex/.svn/all-wcprops b/fake_pyrex/Pyrex/.svn/all-wcprops deleted file mode 100644 index 817c22f..0000000 --- a/fake_pyrex/Pyrex/.svn/all-wcprops +++ /dev/null @@ -1,11 +0,0 @@ -K 25 -svn:wc:ra_dav:version-url -V 47 -/svn/!svn/ver/46219/lxml/trunk/fake_pyrex/Pyrex -END -__init__.py -K 25 -svn:wc:ra_dav:version-url -V 59 -/svn/!svn/ver/46219/lxml/trunk/fake_pyrex/Pyrex/__init__.py -END diff --git a/fake_pyrex/Pyrex/.svn/entries b/fake_pyrex/Pyrex/.svn/entries deleted file mode 100644 index 15b734c..0000000 --- a/fake_pyrex/Pyrex/.svn/entries +++ /dev/null @@ -1,65 +0,0 @@ -10 - -dir -80414 -http://codespeak.net/svn/lxml/trunk/fake_pyrex/Pyrex -http://codespeak.net/svn - - - -2007-08-31T17:01:53.941550Z -46219 -scoder - - - - - - - - - - - - - - -fd0d7bf2-dfb6-0310-8d31-b7ecfe96aada - -Distutils -dir - -__init__.py -file - - - - -2012-01-04T20:10:47.429233Z -8213a7cbff30b82637a6a31ea1b8e4c1 -2007-08-31T17:01:53.941550Z -46219 -scoder - - - - - - - - - - - - - - - - - - - - - -48 - diff --git a/fake_pyrex/Pyrex/.svn/text-base/__init__.py.svn-base b/fake_pyrex/Pyrex/.svn/text-base/__init__.py.svn-base deleted file mode 100644 index 51c8e16..0000000 --- a/fake_pyrex/Pyrex/.svn/text-base/__init__.py.svn-base +++ /dev/null @@ -1 +0,0 @@ -# work around broken setuptools monkey patching diff --git a/fake_pyrex/Pyrex/Distutils/.svn/all-wcprops b/fake_pyrex/Pyrex/Distutils/.svn/all-wcprops deleted file mode 100644 index 6490f9f..0000000 --- a/fake_pyrex/Pyrex/Distutils/.svn/all-wcprops +++ /dev/null @@ -1,17 +0,0 @@ -K 25 -svn:wc:ra_dav:version-url -V 57 -/svn/!svn/ver/46219/lxml/trunk/fake_pyrex/Pyrex/Distutils -END -__init__.py -K 25 -svn:wc:ra_dav:version-url -V 69 -/svn/!svn/ver/46219/lxml/trunk/fake_pyrex/Pyrex/Distutils/__init__.py -END -build_ext.py -K 25 -svn:wc:ra_dav:version-url -V 70 -/svn/!svn/ver/46219/lxml/trunk/fake_pyrex/Pyrex/Distutils/build_ext.py -END diff --git a/fake_pyrex/Pyrex/Distutils/.svn/entries b/fake_pyrex/Pyrex/Distutils/.svn/entries deleted file mode 100644 index aa6a801..0000000 --- a/fake_pyrex/Pyrex/Distutils/.svn/entries +++ /dev/null @@ -1,96 +0,0 @@ -10 - -dir -80414 -http://codespeak.net/svn/lxml/trunk/fake_pyrex/Pyrex/Distutils -http://codespeak.net/svn - - - -2007-08-31T17:01:53.941550Z -46219 -scoder - - - - - - - - - - - - - - -fd0d7bf2-dfb6-0310-8d31-b7ecfe96aada - -__init__.py -file - - - - -2012-01-04T20:10:47.421233Z -8213a7cbff30b82637a6a31ea1b8e4c1 -2007-08-31T17:01:53.941550Z -46219 -scoder - - - - - - - - - - - - - - - - - - - - - -48 - -build_ext.py -file - - - - -2012-01-04T20:10:47.421233Z -708366fb576674605bad33ea1d8600f4 -2007-08-31T17:01:53.941550Z -46219 -scoder - - - - - - - - - - - - - - - - - - - - - -31 - diff --git a/fake_pyrex/Pyrex/Distutils/.svn/text-base/__init__.py.svn-base b/fake_pyrex/Pyrex/Distutils/.svn/text-base/__init__.py.svn-base deleted file mode 100644 index 51c8e16..0000000 --- a/fake_pyrex/Pyrex/Distutils/.svn/text-base/__init__.py.svn-base +++ /dev/null @@ -1 +0,0 @@ -# work around broken setuptools monkey patching diff --git a/fake_pyrex/Pyrex/Distutils/.svn/text-base/build_ext.py.svn-base b/fake_pyrex/Pyrex/Distutils/.svn/text-base/build_ext.py.svn-base deleted file mode 100644 index 4f846f6..0000000 --- a/fake_pyrex/Pyrex/Distutils/.svn/text-base/build_ext.py.svn-base +++ /dev/null @@ -1 +0,0 @@ -build_ext = "yes, it's there!" diff --git a/src/bloomfilter.c b/src/bloomfilter.c index 0e54660..a3da1c5 100644 --- a/src/bloomfilter.c +++ b/src/bloomfilter.c @@ -25,6 +25,7 @@ BloomFilter *bloomfilter_Create_Malloc(size_t max_num_elem, double error_rate, bf->bf_version = BF_CURRENT_VERSION; bf->elem_count = 0; bf->array = NULL; + bf->elem_count_p = NULL; memset(bf->reserved, 0, sizeof(uint32_t) * 32); memset(bf->hash_seeds, 0, sizeof(uint32_t) * 256); memcpy(bf->hash_seeds, hash_seeds, sizeof(uint32_t) * num_hashes); @@ -57,6 +58,7 @@ BloomFilter *bloomfilter_Create_Mmap(size_t max_num_elem, double error_rate, bf->bf_version = BF_CURRENT_VERSION; bf->elem_count = 0; bf->array = NULL; + bf->elem_count_p = NULL; memset(bf->reserved, 0, sizeof(uint32_t) * 32); memset(bf->hash_seeds, 0, sizeof(uint32_t) * 256); memcpy(bf->hash_seeds, hash_seeds, sizeof(uint32_t) * num_hashes); @@ -81,6 +83,10 @@ BloomFilter *bloomfilter_Create_Mmap(size_t max_num_elem, double error_rate, /* Since we just initialized from a file, we have to fix our pointers */ bf->array = array; + + /* mmap address of bf->elem_count */ + bf->elem_count_p = (uint64_t *) ((char *) bf->array->vector + MBAMAGICSIZE + sizeof (BTYPE) + sizeof (int32_t)); + return bf; } diff --git a/src/bloomfilter.h b/src/bloomfilter.h index 95defab..7f361bc 100644 --- a/src/bloomfilter.h +++ b/src/bloomfilter.h @@ -6,6 +6,8 @@ #define BF_CURRENT_VERSION 1 struct _BloomFilter { + unsigned char count_correct; + uint64_t * elem_count_p; uint64_t max_num_elem; double error_rate; uint32_t num_hashes; @@ -13,7 +15,6 @@ struct _BloomFilter { /* All of the bit data is already in here. */ MBArray * array; unsigned char bf_version; - unsigned char count_correct; uint64_t elem_count; uint32_t reserved[32]; }; @@ -68,6 +69,8 @@ static inline int bloomfilter_Add(BloomFilter * bf, Key * key) } if (!result && bf->count_correct) { bf->elem_count ++; + if (bf->elem_count_p != NULL) + *(bf->elem_count_p) = bf->elem_count; } return result; }