/* * Note: Uncompressed chunk size is used in the compressor side * (userspace side for compression). * It is hardcoded because there is not proper way to extract it * from the binary stream which is generated by the preliminary * version of LZ4 tool so far.
*/ #define LZ4_DEFAULT_UNCOMPRESSED_CHUNK_SIZE (8 << 20) #define ARCHIVE_MAGICNUMBER 0x184C2102
STATICinlineint INIT unlz4(u8 *input, long in_len, long (*fill)(void *, unsignedlong), long (*flush)(void *, unsignedlong),
u8 *output, long *posp, void (*error) (char *x))
{ int ret = -1;
size_t chunksize = 0;
size_t uncomp_chunksize = LZ4_DEFAULT_UNCOMPRESSED_CHUNK_SIZE;
u8 *inp;
u8 *inp_start;
u8 *outp; long size = in_len; #ifdef PREBOOT
size_t out_len = get_unaligned_le32(input + in_len); #endif
size_t dest_len;
if (output) {
outp = output;
} elseif (!flush) {
error("NULL output pointer and no flush function provided"); goto exit_0;
} else {
outp = large_malloc(uncomp_chunksize); if (!outp) {
error("Could not allocate output buffer"); goto exit_0;
}
}
if (input && fill) {
error("Both input pointer and fill function provided,"); goto exit_1;
} elseif (input) {
inp = input;
} elseif (!fill) {
error("NULL input pointer and missing fill function"); goto exit_1;
} else {
inp = large_malloc(LZ4_compressBound(uncomp_chunksize)); if (!inp) {
error("Could not allocate input buffer"); goto exit_1;
}
}
inp_start = inp;
if (posp)
*posp = 0;
if (fill) {
size = fill(inp, 4); if (size < 4) {
error("data corrupted"); goto exit_2;
}
}
exit_3:
ret = 0;
exit_2: if (!input)
large_free(inp_start);
exit_1: if (!output)
large_free(outp);
exit_0: return ret;
}
#ifdef PREBOOT STATICint INIT __decompress(unsignedchar *buf, long in_len, long (*fill)(void*, unsignedlong), long (*flush)(void*, unsignedlong), unsignedchar *output, long out_len, long *posp, void (*error)(char *x)
)
{ return unlz4(buf, in_len - 4, fill, flush, output, posp, error);
} #endif
Messung V0.5 in Prozent
¤ Diese beiden folgenden Angebotsgruppen bietet das Unternehmen0.13Angebot
(Wie Sie bei der Firma Beratungs- und Dienstleistungen beauftragen können 2026-04-26)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.