Eric Biggers wrote: > On Sun, Aug 10, 2014 at 10:45:16AM +0200, Jean-Pierre André wrote: >> You have defined the hash table on static data, and I do >> not want to enter into the meanings of static data in >> shared objects in various operating systems (allowed or >> not, shared by threads or not...). I prefer to have it >> dynamically allocated (hence never shared by mounts), >> and pointed to in the "volume" structure. Unfortunately >> this means adding an extra argument to >> ntfs_compress_block() and freeing the table when unmounting. >> (I will later post the code for that). >> > Yes, I wondered if that would cause issues. Since the algorithm does not > depend > on the specific hash function used, an alternative to jumping through hoops to > use the crc32_table is to swap ntfs_hash() with another 3-byte hash function, > one that does not rely on static data. I will try some other ones (zlib-like > which I've already tested a little bit, and maybe multiplicative hashing) and > see how they affect the results.
I gather the crc polynomial you propose has proved efficient in other compression algorithm, and is supposed to be stable. Then a simpler way is to compute the table once for all, and encode it as an array of constants. Just comment out the encoding function in case someone would like to test other polynomials. >> Also a minor issue : please use >> http://sourceforge.net/p/ntfs-3g/ntfs-3g/ci/edge/tree/libntfs-3g/compress.c >> as a reference for your patch for easier integration. > Will do next time. I somehow missed the fact that this repository even > exists! > Looks like the only conflict is in the change to the copyright block... Indeed. Jean-Pierre > > Eric > ------------------------------------------------------------------------------ _______________________________________________ ntfs-3g-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/ntfs-3g-devel
