comparison contrib/python-zstandard/zstd/common/zstd_internal.h @ 30822:b54a2984cdd4

zstd: vendor python-zstandard 0.6.0 Commit 63c68d6f5fc8de4afd9bde81b13b537beb4e47e8 from https://github.com/indygreg/python-zstandard is imported without modifications (other than removing unwanted files). This includes minor performance and feature improvements. It also changes the vendored zstd library from 1.1.1 to 1.1.2. # no-check-commit
author Gregory Szorc <gregory.szorc@gmail.com>
date Sat, 14 Jan 2017 19:41:43 -0800
parents 2e484bdea8c4
children c32454d69b85
comparison
equal deleted inserted replaced
30821:7005c03f7387 30822:b54a2984cdd4
145 #define COPY8(d,s) { ZSTD_copy8(d,s); d+=8; s+=8; } 145 #define COPY8(d,s) { ZSTD_copy8(d,s); d+=8; s+=8; }
146 146
147 /*! ZSTD_wildcopy() : 147 /*! ZSTD_wildcopy() :
148 * custom version of memcpy(), can copy up to 7 bytes too many (8 bytes if length==0) */ 148 * custom version of memcpy(), can copy up to 7 bytes too many (8 bytes if length==0) */
149 #define WILDCOPY_OVERLENGTH 8 149 #define WILDCOPY_OVERLENGTH 8
150 MEM_STATIC void ZSTD_wildcopy(void* dst, const void* src, size_t length) 150 MEM_STATIC void ZSTD_wildcopy(void* dst, const void* src, ptrdiff_t length)
151 { 151 {
152 const BYTE* ip = (const BYTE*)src; 152 const BYTE* ip = (const BYTE*)src;
153 BYTE* op = (BYTE*)dst; 153 BYTE* op = (BYTE*)dst;
154 BYTE* const oend = op + length; 154 BYTE* const oend = op + length;
155 do 155 do
220 U32 log2matchSum; 220 U32 log2matchSum;
221 U32 log2litLengthSum; 221 U32 log2litLengthSum;
222 U32 log2litSum; 222 U32 log2litSum;
223 U32 log2offCodeSum; 223 U32 log2offCodeSum;
224 U32 factor; 224 U32 factor;
225 U32 staticPrices;
225 U32 cachedPrice; 226 U32 cachedPrice;
226 U32 cachedLitLength; 227 U32 cachedLitLength;
227 const BYTE* cachedLiterals; 228 const BYTE* cachedLiterals;
228 } seqStore_t; 229 } seqStore_t;
229 230
232 int ZSTD_isSkipFrame(ZSTD_DCtx* dctx); 233 int ZSTD_isSkipFrame(ZSTD_DCtx* dctx);
233 234
234 /* custom memory allocation functions */ 235 /* custom memory allocation functions */
235 void* ZSTD_defaultAllocFunction(void* opaque, size_t size); 236 void* ZSTD_defaultAllocFunction(void* opaque, size_t size);
236 void ZSTD_defaultFreeFunction(void* opaque, void* address); 237 void ZSTD_defaultFreeFunction(void* opaque, void* address);
238 #ifndef ZSTD_DLL_IMPORT
237 static const ZSTD_customMem defaultCustomMem = { ZSTD_defaultAllocFunction, ZSTD_defaultFreeFunction, NULL }; 239 static const ZSTD_customMem defaultCustomMem = { ZSTD_defaultAllocFunction, ZSTD_defaultFreeFunction, NULL };
240 #endif
238 void* ZSTD_malloc(size_t size, ZSTD_customMem customMem); 241 void* ZSTD_malloc(size_t size, ZSTD_customMem customMem);
239 void ZSTD_free(void* ptr, ZSTD_customMem customMem); 242 void ZSTD_free(void* ptr, ZSTD_customMem customMem);
240 243
241 244
242 /*====== common function ======*/ 245 /*====== common function ======*/