Comments (6)
Very good point.
I was in fact considering removing these functions, since apparently no one was
interested in using them.
But if there is some need for them, then, as you suggest, for the sake of
completeness, functions to free the memory context should be provided too.
Original comment by [email protected]
on 1 Jul 2012 at 7:16
from lz4.
I don't think you should remove them. They aren't widely because there is no
functions to alloc and free a context.
You should have LZ4_allocCtx and LZ4_freeCtx. You should also make the
interface consistent with LZ4HC. LZ4HC already has alloc/free functions. You
should expose those as well. LZ4_64KLIMIT would also need to be exposed so
people can use it to determine if they should use LZ4_compress64Ctx or
LZ4_compressCtx.
Also I recommend converting LZ4_compressBound into a macro and adding one for
the inverse formula.
#define LZ4_compressBound(isize) (unsigned)((isize) + ((isize) / 255) + 16)
#define LZ4_compressInbound(osize) (unsigned)(((255 * ((osize) - 16)) / 256) -
1)
You could even rename them to something that makes more sense like
LZ4_compressOutputBound(isize) or LZ4_compressInputBound(osize).
Original comment by [email protected]
on 10 Jul 2012 at 9:55
from lz4.
This definitely makes sense.
I'll look into it.
Original comment by [email protected]
on 10 Jul 2012 at 10:53
- Changed state: Accepted
from lz4.
This shall be classified as enhancement request.
Original comment by [email protected]
on 10 Jul 2012 at 10:53
- Added labels: Type-Enhancement
- Removed labels: Type-Defect
from lz4.
On second thought, it might not make any sense to expose Ctx. If the Ctx were
used to hold the state of the compressor or uncompressor during successive
calls to LZ4_compress or LZ4_uncompress, then it might make sense to expose it.
But as it is now, it should probably just remain configurable via a #define in
the source file as it is now, because it really only affects the compiler/env.
I'm not sure why you would want to allocate it yourself, when you can simply
put it on the stack.
Original comment by [email protected]
on 11 Jul 2012 at 3:15
from lz4.
Functions explicitly handling the context are now removed from the standard *.h
interface.
It's possible to use them by including directly the *.c, or creating/modifying
your own *.h
Original comment by [email protected]
on 28 Jul 2012 at 1:45
- Changed state: Fixed
from lz4.
Related Issues (20)
- Clang compiler warnings HOT 6
- LZ4F_compressBound() using null PreferencesPtr HOT 3
- lz4io license HOT 6
- Commandline lz4 stops when decompressing a concatenated lz4 file representing an empty file HOT 4
- Kernel wont boot with CONFIG_DYNAMIC_DEBUG=y HOT 2
- Bad alignment detection & setting on Sparc Solaris HOT 2
- lz4 r124 breaks ABI without bumping soname HOT 22
- Do not call sudo in Makefile HOT 3
- LZ4 HC r126 crashes when compiled with GCC 4.9 on highest optimization settings HOT 1
- lz4frame should correctly handle skipped frames HOT 4
- LZ4 cli invocation should match other compressors for non-option arguments HOT 14
- sudo make install does not cp files to /usr/local HOT 6
- lz4 auto-decompress does not work HOT 3
- Force should pass thru bytes unchanged HOT 5
- lz4 cli should support sparse file HOT 22
- decompression same file on different platforms HOT 3
- Static code analysis warnings HOT 10
- Google Code will close HOT 3
- [Query]Can LZo algorithm optimized for ARM NEON (SIMD instructions). HOT 3
- Potential Size Extension Problem in LZ4F_readLE64 HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from lz4.