Hacker News new | ask | show | jobs
by user-the-name 1610 days ago
If you are working on a microcontroller, odds are you will be keeping your entire file in RAM as that is all you have, in which case you should not need any memory for a window at all, as you can just use the file itself.

I don't know if the zstd implementation supports working like this, though.

1 comments

I believe you can compress into the source buffer and keep the read offset ahead of the write offset, but I don't think you can decompress this way.
This is about the window buffer, not the source and destination buffers. They are still distinct, but you can combine the uncompressed buffer and the window buffer, if you have, or are going to have, the entire uncompressed data in memory.