You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently the bloomfilter files generated on 32bit machines are not compatible on 64 bit machines, and vice versa.
One of the causes is the pointer size differences that is used in the bloomfilter file.
Is it possible to make it compatible between the two architectures?
The text was updated successfully, but these errors were encountered:
A minimal patch to do this is below. It does have the effect of being incompatible with previous versions, which may be an issue. If you want to be able to read old versions you need to be able to detect them first, which is tricky currently, but doable.
But, if we're going to change the file format, there are a number of other suggestions:
The "MBITARRAY" at the beginning of the file is nine bytes, so everything else is not aligned in memory. Suggest "MBITARRY" or something like that.
Move the version field to the front so it's always in the same place. Easier to make future changes.
diff --git a/src/bloomfilter.h b/src/bloomfilter.h
index 95defab..ba318b1 100644
--- a/src/bloomfilter.h
+++ b/src/bloomfilter.h
@@ -11,11 +11,13 @@ struct _BloomFilter {
uint32_t num_hashes;
uint32_t hash_seeds[256];
/* 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];
+ union {
+ uint32_t reserved[32];
+ MBArray * array;
+ };
};
typedef struct {
Currently the bloomfilter files generated on 32bit machines are not compatible on 64 bit machines, and vice versa.
One of the causes is the pointer size differences that is used in the bloomfilter file.
Is it possible to make it compatible between the two architectures?
The text was updated successfully, but these errors were encountered: