decomp: Switching from dest_size to dest_limit
pfalcon opened this issue · 1 comments
Since 50590fb, there's asymmetry with how source vs dest end is handled: for source, it's source_limit, while for destination it's dest_size. For reference, #10, which prompted addition of source_limit, also used "limit" concept for dest too, but it was found superfluous, duplicating existing dest_size checking.
However, I lean towards switching to dest_limit, because it simplifies dest progress tracking and checking: instead of dest++, dest_size--, it takes just dest++ (and < comparison for end test, yes). Currently, dest_size-- happens in one place, but that's because all decompression functions require to produce a single byte. That's obviously a bottleneck, and it would be nice to play with local optimizations of handling multiple bytes in some cases (while still single byte in others). That's where decrementing dest_size in multiple places becomes hairy, while "idempotent" comparison dest < dest_limit
simplifies things.