RJVB / afsctool

This is a version of "brkirch"'s afsctool utility that allows end-users to leverage HFS+ compression.
https://brkirch.wordpress.com/afsctool
GNU General Public License v3.0
187 stars 18 forks source link

Make lzvn/lzfse slightly smaller #58

Closed Dr-Emann closed 1 year ago

Dr-Emann commented 1 year ago

The chunk table should have numBlocks 32 bit numbers: by using numBlocks * sizeof(chunktable) bytes, we were instead making the chunk table 2 times too large on 64 bit machines:

sizeof(chunkTable) is sizeof(pointer), but we really only want 4 bytes per item

RJVB commented 1 year ago

Thanks. My memory of the implementation is a bit rusty; I take it you checked what your change implies for the resulting compressed files?

(I guess I really should sit down sometime to rewrite the code as something much more readable ...)

Dr-Emann commented 1 year ago

Did some more testing, and found a problem, but now this works consistently with both LZVN and LZFSE with whatever random files I throw at it.

Yeah, the code is pretty hard to navigate, it could definitely use some cleanup at some point.