Lines Matching full:0

41  * in memory stack (0:default, fastest), or in memory heap (1:requires malloc()).
49 * Select "acceleration" for LZ4_compress_fast() when parameter value <= 0
67 * Method 0 (default) : use `memcpy()`. Safe and portable.
74 * Prefer these methods in priority order (0 > 1 > 2)
174 #define likely(expr) expect((expr) != 0, 1)
177 #define unlikely(expr) expect((expr) != 0, 0)
181 * it can be disabled by setting LZ4_ALIGN_TEST to 0 */
245 # define assert(condition) ((void)0)
266 return ((size_t)ptr & (alignment -1)) == 0; in LZ4_isAligned()
301 notLimited = 0,
328 return one.c[0]; in LZ4_isLittleEndian()
391 return (U16)((U16)p[0] + (p[1]<<8)); in LZ4_readLE16()
401 p[0] = (BYTE) value; in LZ4_writeLE16()
417 static const unsigned inc32table[8] = {0, 1, 2, 1, 0, 4, 4, 4};
418 static const int dec64table[8] = {0, 0, 0, -1, -4, 1, 2, 3};
430 # define LZ4_FAST_DEC_LOOP 0
441 LZ4_write32(dstPtr, 0); /* silence an msan warning when offset==0 */ in LZ4_memcpy_using_offset_base()
442 dstPtr[0] = srcPtr[0]; in LZ4_memcpy_using_offset_base()
515 assert(val != 0); in LZ4_NbCommonBytes()
522 unsigned long r = 0; in LZ4_NbCommonBytes()
530 const U64 m = 0x0101010101010101ULL; in LZ4_NbCommonBytes()
544 const U32 m = 0x01010101; in LZ4_NbCommonBytes()
559 7, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0, in LZ4_NbCommonBytes()
560 4, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0, in LZ4_NbCommonBytes()
561 5, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0, in LZ4_NbCommonBytes()
562 4, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0, in LZ4_NbCommonBytes()
563 6, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0, in LZ4_NbCommonBytes()
564 4, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0, in LZ4_NbCommonBytes()
565 5, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0, in LZ4_NbCommonBytes()
566 4, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0, in LZ4_NbCommonBytes()
568 U64 const mask = 0x0101010101010101ULL; in LZ4_NbCommonBytes()
570 return ctz7_tab[(t * 0x0080402010080402ULL) >> 57]; in LZ4_NbCommonBytes()
579 if (!(val>>by32)) { r=4; } else { r=0; val>>=by32; } in LZ4_NbCommonBytes()
592 val = ((((val + 0x00FFFF00) | 0x00FFFFFF) + val) | in LZ4_NbCommonBytes()
593 (val + 0x00FF0000)) >> 24; in LZ4_NbCommonBytes()
640 typedef enum { clearedTable = 0, byPtr, byU32, byU16 } tableType_t;
665 typedef enum { noDict = 0, withPrefix64k, usingExtDict, usingDictCtx } dict_directive;
666 typedef enum { noDictIssue = 0, dictSmall } dictIssue_directive;
729 case clearedTable: { /* illegal! */ assert(0); return; } in LZ4_clearHash()
731 case byU32: { U32* hashTable = (U32*) tableBase; hashTable[h] = 0; return; } in LZ4_clearHash()
732 case byU16: { U16* hashTable = (U16*) tableBase; hashTable[h] = 0; return; } in LZ4_clearHash()
742 case byPtr: { /* illegal! */ assert(0); return; } in LZ4_putIndexOnHash()
754 case clearedTable: { /* illegal! */ assert(0); return; } in LZ4_putPositionOnHash()
786 assert(0); return 0; /* forbidden case */ in LZ4_getIndexOnHash()
814 assert(inputSize >= 0); in LZ4_prepareTable()
816 || ((tableType == byU16) && cctx->currentOffset + (unsigned)inputSize >= 0xFFFFU) in LZ4_prepareTable()
822 MEM_INIT(cctx->hashTable, 0, LZ4_HASHTABLESIZE); in LZ4_prepareTable()
823 cctx->currentOffset = 0; in LZ4_prepareTable()
832 * currentOffset == 0 is faster still, so we preserve that case. in LZ4_prepareTable()
834 if (cctx->currentOffset != 0 && tableType == byU32) { in LZ4_prepareTable()
842 cctx->dictSize = 0; in LZ4_prepareTable()
849 * - inputSize > 0
876 …const U32 dictDelta = (dictDirective == usingDictCtx) ? startIndex - dictCtx->currentOffset : 0; … in LZ4_compress_generic_validated()
895 U32 offset = 0; in LZ4_compress_generic_validated()
902 …if (outputDirective == fillOutput && maxOutputSize < 1) { return 0; } /* Impossible to store anyth… in LZ4_compress_generic_validated()
903 …if ((tableType == byU16) && (inputSize>=LZ4_64Klimit)) { return 0; } /* Size too large (not withi… in LZ4_compress_generic_validated()
907 lowLimit = (const BYTE*)source - (dictDirective == withPrefix64k ? dictSize : 0); in LZ4_compress_generic_validated()
1026 …return 0; /* cannot compress within `dst` budget. Stored indexes in hash table are nonetheless f… in LZ4_compress_generic_validated()
1067 assert(offset <= LZ4_DISTANCE_MAX && offset > 0); in LZ4_compress_generic_validated()
1120 …return 0; /* cannot compress within `dst` budget. Stored indexes in hash table are nonetheless f… in LZ4_compress_generic_validated()
1126 LZ4_write32(op, 0xFFFFFFFF); in LZ4_compress_generic_validated()
1129 LZ4_write32(op, 0xFFFFFFFF); in LZ4_compress_generic_validated()
1155 { token=op++; *token=0; goto _next_match; } in LZ4_compress_generic_validated()
1191 *token=0; in LZ4_compress_generic_validated()
1194 (int)(anchor-(const BYTE*)source), 0, (int)(ip-(const BYTE*)source)); in LZ4_compress_generic_validated()
1216 …return 0; /* cannot compress within `dst` budget. Stored indexes in hash table are nonetheless f… in LZ4_compress_generic_validated()
1237 assert(result > 0); in LZ4_compress_generic_validated()
1244 * takes care of src == (NULL, 0)
1262 …if ((U32)srcSize > (U32)LZ4_MAX_INPUT_SIZE) { return 0; } /* Unsupported srcSize, too large (or n… in LZ4_compress_generic()
1263 if (srcSize == 0) { /* src == NULL supported if srcSize == 0 */ in LZ4_compress_generic()
1264 …if (outputDirective != notLimited && dstCapacity <= 0) return 0; /* no output, can't write anythi… in LZ4_compress_generic()
1268 dst[0] = 0; in LZ4_compress_generic()
1271 *inputConsumed = 0; in LZ4_compress_generic()
1292 …return LZ4_compress_generic(ctx, source, dest, inputSize, NULL, 0, notLimited, byU16, noDict, noDi… in LZ4_compress_fast_extState()
1295 …return LZ4_compress_generic(ctx, source, dest, inputSize, NULL, 0, notLimited, tableType, noDict, … in LZ4_compress_fast_extState()
1327 …return LZ4_compress_generic(ctx, src, dst, srcSize, NULL, 0, notLimited, tableType, noDict, dictSm… in LZ4_compress_fast_extState_fastReset()
1329 …return LZ4_compress_generic(ctx, src, dst, srcSize, NULL, 0, notLimited, tableType, noDict, noDict… in LZ4_compress_fast_extState_fastReset()
1334 …return LZ4_compress_generic(ctx, src, dst, srcSize, NULL, 0, notLimited, tableType, noDict, noDict… in LZ4_compress_fast_extState_fastReset()
1359 if (ctxPtr == NULL) return 0; in LZ4_compress_fast()
1403 if (ctx == NULL) return 0; in LZ4_compress_destSize()
1449 MEM_INIT(buffer, 0, sizeof(LZ4_stream_t_internal)); in LZ4_initStream()
1458 MEM_INIT(LZ4_stream, 0, sizeof(LZ4_stream_t_internal)); in LZ4_resetStream()
1462 LZ4_prepareTable(&(ctx->internal_donotuse), 0, byU32); in LZ4_resetStream_fast()
1467 if (!LZ4_stream) return 0; /* support free on NULL */ in LZ4_freeStream()
1470 return (0); in LZ4_freeStream()
1500 return 0; in LZ4_loadDict()
1523 dictCtx != NULL ? dictCtx->dictSize : 0); in LZ4_attach_dictionary()
1531 if (workingStream->internal_donotuse.currentOffset == 0) { in LZ4_attach_dictionary()
1537 if (dictCtx->dictSize == 0) { in LZ4_attach_dictionary()
1547 assert(nextSize >= 0); in LZ4_renormDictT()
1548 …if (LZ4_dict->currentOffset + (unsigned)nextSize > 0x80000000) { /* potential ptrdiff_t overflow… in LZ4_renormDictT()
1554 for (i=0; i<LZ4_HASH_SIZE_U32; i++) { in LZ4_renormDictT()
1555 if (LZ4_dict->hashTable[i] < delta) LZ4_dict->hashTable[i]=0; in LZ4_renormDictT()
1584 streamPtr->dictSize = 0; in LZ4_compress_fast_continue()
1594 if (streamPtr->dictSize < 4) streamPtr->dictSize = 0; in LZ4_compress_fast_continue()
1649 …result = LZ4_compress_generic(streamPtr, source, dest, srcSize, NULL, 0, notLimited, byU32, usingE… in LZ4_compress_forceExtDict()
1651 …result = LZ4_compress_generic(streamPtr, source, dest, srcSize, NULL, 0, notLimited, byU32, usingE… in LZ4_compress_forceExtDict()
1666 * Return : saved dictionary size in bytes (necessarily <= dictSize), or 0 if error.
1676 if (safeBuffer == NULL) assert(dictSize == 0); in LZ4_saveDict()
1677 if (dictSize > 0) in LZ4_saveDict()
1692 typedef enum { endOnOutputSize = 0, endOnInputSize = 1 } endCondition_directive;
1693 typedef enum { decode_full_block = 0, partial_decode = 1 } earlyEnd_directive;
1704 * error (output) - error code. Should be set to 0 before call.
1706 typedef enum { loop_error = -2, initial_error = -1, ok = 0 } variable_length_error;
1712 U32 length = 0; in read_variable_length()
1749 const size_t dictSize /* note : = 0 if noDict */ in LZ4_decompress_generic()
1781 if ((endOnInput) && (unlikely(outputSize==0))) { in LZ4_decompress_generic()
1783 if (partialDecoding) return 0; in LZ4_decompress_generic()
1784 return ((srcSize==1) && (*ip==0)) ? 0 : -1; in LZ4_decompress_generic()
1786 if ((!endOnInput) && (unlikely(outputSize==0))) { return (*ip==0 ? 1 : -1); } in LZ4_decompress_generic()
1787 if ((endOnInput) && unlikely(srcSize==0)) { return -1; } in LZ4_decompress_generic()
1854 … length += read_variable_length(&ip, iend - LASTLITERALS + 1, (int)endOnInput, 0, &error); in LZ4_decompress_generic()
1936 * 1) If the literal length is 0..14, and there is enough space, in LZ4_decompress_generic()
1963 LZ4_memcpy(op + 0, match + 0, 8); in LZ4_decompress_generic()
2064 … length += read_variable_length(&ip, iend - LASTLITERALS + 1, (int)endOnInput, 0, &error); in LZ4_decompress_generic()
2123 LZ4_write32(op, 0); /* silence msan warning when offset==0 */ in LZ4_decompress_generic()
2124 op[0] = match[0]; in LZ4_decompress_generic()
2175 (BYTE*)dest, NULL, 0); in LZ4_decompress_safe()
2184 noDict, (BYTE*)dst, NULL, 0); in LZ4_decompress_safe_partial()
2190 return LZ4_decompress_generic(source, dest, 0, originalSize, in LZ4_decompress_fast()
2192 (BYTE*)dest - 64 KB, NULL, 0); in LZ4_decompress_fast()
2202 (BYTE*)dest - 64 KB, NULL, 0); in LZ4_decompress_safe_withPrefix64k()
2219 (BYTE*)dest-prefixSize, NULL, 0); in LZ4_decompress_safe_withSmallPrefix()
2236 return LZ4_decompress_generic(source, dest, 0, originalSize, in LZ4_decompress_fast_extDict()
2258 return LZ4_decompress_generic(source, dest, 0, originalSize, in LZ4_decompress_fast_doubleDict()
2274 if (LZ4_stream == NULL) { return 0; } /* support free on NULL */ in LZ4_freeStreamDecode()
2276 return 0; in LZ4_freeStreamDecode()
2282 * Loading a size of 0 is allowed (same effect as no dictionary).
2283 * @return : 1 if OK, 0 if error
2291 lz4sd->extDictSize = 0; in LZ4_setStreamDecode()
2304 * or 0 if there is an error (invalid maxBlockSize).
2308 if (maxBlockSize < 0) return 0; in LZ4_decoderRingBufferSize()
2309 if (maxBlockSize > LZ4_MAX_INPUT_SIZE) return 0; in LZ4_decoderRingBufferSize()
2327 if (lz4sd->prefixSize == 0) { in LZ4_decompress_safe_continue()
2329 assert(lz4sd->extDictSize == 0); in LZ4_decompress_safe_continue()
2331 if (result <= 0) return result; in LZ4_decompress_safe_continue()
2338 else if (lz4sd->extDictSize == 0) in LZ4_decompress_safe_continue()
2344 if (result <= 0) return result; in LZ4_decompress_safe_continue()
2353 if (result <= 0) return result; in LZ4_decompress_safe_continue()
2366 assert(originalSize >= 0); in LZ4_decompress_fast_continue()
2368 if (lz4sd->prefixSize == 0) { in LZ4_decompress_fast_continue()
2369 assert(lz4sd->extDictSize == 0); in LZ4_decompress_fast_continue()
2371 if (result <= 0) return result; in LZ4_decompress_fast_continue()
2375 if (lz4sd->prefixSize >= 64 KB - 1 || lz4sd->extDictSize == 0) in LZ4_decompress_fast_continue()
2380 if (result <= 0) return result; in LZ4_decompress_fast_continue()
2388 if (result <= 0) return result; in LZ4_decompress_fast_continue()
2406 if (dictSize==0) in LZ4_decompress_safe_usingDict()
2412 assert(dictSize >= 0); in LZ4_decompress_safe_usingDict()
2415 assert(dictSize >= 0); in LZ4_decompress_safe_usingDict()
2421 if (dictSize==0 || dictStart+dictSize == dest) in LZ4_decompress_fast_usingDict()
2423 assert(dictSize >= 0); in LZ4_decompress_fast_usingDict()
2480 return 0; in LZ4_resetStreamState()