wangxuan95 / tinylzma Goto Github PK
View Code? Open in Web Editor NEWA minimal LZMA data compressor & decompressor. Only hundreds of lines of C. 一个只有几百行C代码的LZMA通用数据压缩器和解压器。
License: GNU General Public License v3.0
A minimal LZMA data compressor & decompressor. Only hundreds of lines of C. 一个只有几百行C代码的LZMA通用数据压缩器和解压器。
License: GNU General Public License v3.0
Hello,
I really like the simplicity of this library, but there is something i cannot understand about the decompression routine,
switch (mode) {
case 1 :
dst_len = DECOMPRESS_OUTPUT_MAX_LEN;
break;
default : // case 2 or 3 :
dst_len = src_len + (src_len>>2) + 4096;
if (dst_len < src_len) // size_t data type overflow
dst_len = (~((size_t)0)); // max value of size_t
break;
}
p_dst = (uint8_t*)malloc(dst_len);
Isn't there a better way to determine how much memory is going to be needed for decompression? Do we really need to allocate a huge memory buffer(512MB) to decompress?
Thanks
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.