PSeitz / lz4_flex

Fastest pure Rust implementation of LZ4 compression/decompression.
MIT License
460 stars 31 forks source link

Add no_std compatibility #9

Closed coolreader18 closed 3 years ago

coolreader18 commented 3 years ago

I also noticed that it doesn't compile on 32-bit targets; I think some of the stuff like read_usize_ptr assume too much about the target platform. I think probably some of the uses of usize should be changed to u64, which is always 8 bytes, although I'm not sure what the lz4 spec says. I tested using:

$ cargo c --target thumbv7em-none-eabi --no-default-features
coolreader18 commented 3 years ago

Oh, also, now you can really claim to be dependency-free :)

PSeitz commented 3 years ago

Thanks, looks good!

I'll have a look at the 32bit issues, maybe I can add 32bit tests to the CI. The spec doesn't cover the implementation, it just defines the format.

PSeitz commented 3 years ago

published with 0.7.0 including 32-bit support