Code Monkey home page Code Monkey logo

Comments (3)

g1mv avatar g1mv commented on August 14, 2024

Yes it's a known behavior, decompression actually needs at least DENSITY_CHAMELEON_DECODE_MINIMUM_OUTPUT_LOOKAHEAD or DENSITY_MANDALA_DECODE_MINIMUM_OUTPUT_LOOKAHEAD bytes to continue processing.
I don't know if this can be filed as a problem or not, because you just need a few hundred extra bytes or trick the decompressor into thinking it has the bytes available for everything to work properly.
In your case, if you use LOREM_IPSUM_LENGTH + DENSITY_CHAMELEON_DECODE_MINIMUM_OUTPUT_LOOKAHEAD as the decompressed buffer length, everything will work, but I agree it's not ideal.

from density.

nemequ avatar nemequ commented on August 14, 2024

For a simple test case like this that would work, but there are plenty of cases where that's not feasible and you would really have no choice but to decompress to a temporary buffer then memcpy over to the real buffer. I would actually guess that most people who would be interested in the buffer to buffer API would fall into that case.

Maybe you could provide *_fast and *_safe versions of the API (kind of like LZ4, as well as some others)? Or tweak the implementation so that the last block decompresses to a temporary buffer if there is not enough space available to decompress it directly to the supplied buffer?

from density.

g1mv avatar g1mv commented on August 14, 2024

Implemented in 9e28aa5

from density.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.