ReactOS 0.4.16-dev-251-ga17b6e9
|
#include "zstd_internal.h"
Go to the source code of this file.
Classes | |
struct | ZSTD_cwksp |
Macros | |
#define | ZSTD_CWKSP_ASAN_REDZONE_SIZE 128 |
Enumerations | |
enum | ZSTD_cwksp_alloc_phase_e { ZSTD_cwksp_alloc_objects , ZSTD_cwksp_alloc_buffers , ZSTD_cwksp_alloc_aligned } |
#define ZSTD_CWKSP_ASAN_REDZONE_SIZE 128 |
Definition at line 35 of file zstd_cwksp.h.
Enumerator | |
---|---|
ZSTD_cwksp_alloc_objects | |
ZSTD_cwksp_alloc_buffers | |
ZSTD_cwksp_alloc_aligned |
Definition at line 41 of file zstd_cwksp.h.
MEM_STATIC size_t ZSTD_cwksp_align | ( | size_t | size, |
size_t const | align | ||
) |
Align must be a power of 2.
Definition at line 164 of file zstd_cwksp.h.
Referenced by ZSTD_createCDict_advanced(), ZSTD_cwksp_reserve_aligned(), ZSTD_cwksp_reserve_object(), ZSTD_estimateCDictSize_advanced(), ZSTD_initCDict_internal(), and ZSTD_initStaticCDict().
MEM_STATIC size_t ZSTD_cwksp_alloc_size | ( | size_t | size | ) |
Use this to determine how much space in the workspace we will consume to allocate this object. (Normally it should be exactly the size of the object, but under special conditions, like ASAN, where we pad each object, it might be larger.)
Since tables aren't currently redzoned, you don't need to call through this to figure out how much space you need for the matchState tables. Everything else is though.
Definition at line 180 of file zstd_cwksp.h.
Referenced by ZSTD_createCDict_advanced(), ZSTD_estimateCCtxSize_usingCCtxParams(), ZSTD_estimateCDictSize_advanced(), ZSTD_estimateCStreamSize_usingCCtxParams(), ZSTD_initStaticCDict(), ZSTD_ldm_getTableSize(), ZSTD_resetCCtx_internal(), and ZSTD_sizeof_matchState().
MEM_STATIC void ZSTD_cwksp_assert_internal_consistency | ( | ZSTD_cwksp * | ws | ) |
Definition at line 151 of file zstd_cwksp.h.
Referenced by ZSTD_cwksp_clear(), ZSTD_cwksp_clear_tables(), ZSTD_cwksp_init(), ZSTD_cwksp_mark_tables_clean(), ZSTD_cwksp_mark_tables_dirty(), ZSTD_cwksp_reserve_internal(), ZSTD_cwksp_reserve_object(), and ZSTD_cwksp_reserve_table().
MEM_STATIC size_t ZSTD_cwksp_available_space | ( | ZSTD_cwksp * | ws | ) |
Definition at line 494 of file zstd_cwksp.h.
Referenced by ZSTD_cwksp_check_available(), ZSTD_cwksp_reserve_internal(), ZSTD_cwksp_reserve_object(), ZSTD_cwksp_reserve_table(), and ZSTD_resetCCtx_internal().
MEM_STATIC void ZSTD_cwksp_bump_oversized_duration | ( | ZSTD_cwksp * | ws, |
size_t | additionalNeededSpace | ||
) |
Definition at line 512 of file zstd_cwksp.h.
Referenced by ZSTD_resetCCtx_internal().
MEM_STATIC int ZSTD_cwksp_check_available | ( | ZSTD_cwksp * | ws, |
size_t | additionalNeededSpace | ||
) |
Definition at line 498 of file zstd_cwksp.h.
Referenced by ZSTD_cwksp_check_too_large(), ZSTD_initStaticCCtx(), and ZSTD_resetCCtx_internal().
MEM_STATIC int ZSTD_cwksp_check_too_large | ( | ZSTD_cwksp * | ws, |
size_t | additionalNeededSpace | ||
) |
Definition at line 502 of file zstd_cwksp.h.
Referenced by ZSTD_cwksp_bump_oversized_duration(), and ZSTD_cwksp_check_wasteful().
MEM_STATIC int ZSTD_cwksp_check_wasteful | ( | ZSTD_cwksp * | ws, |
size_t | additionalNeededSpace | ||
) |
Definition at line 507 of file zstd_cwksp.h.
Referenced by ZSTD_resetCCtx_internal().
MEM_STATIC void ZSTD_cwksp_clean_tables | ( | ZSTD_cwksp * | ws | ) |
Zero the part of the allocated tables not already marked clean.
Definition at line 378 of file zstd_cwksp.h.
Referenced by ZSTD_reset_matchState().
MEM_STATIC void ZSTD_cwksp_clear | ( | ZSTD_cwksp * | ws | ) |
Invalidates all buffer, aligned, and table allocations. Object allocations remain valid.
Definition at line 410 of file zstd_cwksp.h.
Referenced by ZSTD_cwksp_init(), and ZSTD_resetCCtx_internal().
MEM_STATIC void ZSTD_cwksp_clear_tables | ( | ZSTD_cwksp * | ws | ) |
Invalidates table allocations. All other allocations remain valid.
Definition at line 392 of file zstd_cwksp.h.
Referenced by ZSTD_reset_matchState().
MEM_STATIC size_t ZSTD_cwksp_create | ( | ZSTD_cwksp * | ws, |
size_t | size, | ||
ZSTD_customMem | customMem | ||
) |
Definition at line 458 of file zstd_cwksp.h.
Referenced by ZSTD_resetCCtx_internal().
MEM_STATIC void ZSTD_cwksp_free | ( | ZSTD_cwksp * | ws, |
ZSTD_customMem | customMem | ||
) |
Definition at line 466 of file zstd_cwksp.h.
Referenced by ZSTD_freeCCtxContent(), ZSTD_freeCDict(), and ZSTD_resetCCtx_internal().
MEM_STATIC void ZSTD_cwksp_init | ( | ZSTD_cwksp * | ws, |
void * | start, | ||
size_t | size | ||
) |
The provided workspace takes ownership of the buffer [start, start+size). Any existing values in the workspace are ignored (the previously managed buffer, if present, must be separately freed).
Definition at line 445 of file zstd_cwksp.h.
Referenced by ZSTD_createCDict_advanced(), ZSTD_cwksp_create(), ZSTD_initStaticCCtx(), and ZSTD_initStaticCDict().
MEM_STATIC void ZSTD_cwksp_internal_advance_phase | ( | ZSTD_cwksp * | ws, |
ZSTD_cwksp_alloc_phase_e | phase | ||
) |
Definition at line 188 of file zstd_cwksp.h.
Referenced by ZSTD_cwksp_reserve_internal(), and ZSTD_cwksp_reserve_table().
MEM_STATIC void ZSTD_cwksp_mark_tables_clean | ( | ZSTD_cwksp * | ws | ) |
Definition at line 365 of file zstd_cwksp.h.
Referenced by ZSTD_copyCCtx_internal(), ZSTD_cwksp_clean_tables(), ZSTD_overflowCorrectIfNeeded(), and ZSTD_resetCCtx_byCopyingCDict().
MEM_STATIC void ZSTD_cwksp_mark_tables_dirty | ( | ZSTD_cwksp * | ws | ) |
Definition at line 345 of file zstd_cwksp.h.
Referenced by ZSTD_copyCCtx_internal(), ZSTD_overflowCorrectIfNeeded(), ZSTD_reset_matchState(), and ZSTD_resetCCtx_byCopyingCDict().
MEM_STATIC void ZSTD_cwksp_move | ( | ZSTD_cwksp * | dst, |
ZSTD_cwksp * | src | ||
) |
Moves the management of a workspace from one cwksp to another. The src cwksp is left in an invalid state (src must be re-init()'ed before its used again).
Definition at line 477 of file zstd_cwksp.h.
Referenced by ZSTD_createCDict_advanced(), ZSTD_initStaticCCtx(), and ZSTD_initStaticCDict().
MEM_STATIC int ZSTD_cwksp_owns_buffer | ( | const ZSTD_cwksp * | ws, |
const void * | ptr | ||
) |
Returns whether this object/buffer/etc was allocated in this workspace.
Definition at line 217 of file zstd_cwksp.h.
Referenced by ZSTD_freeCCtx(), and ZSTD_freeCDict().
MEM_STATIC void * ZSTD_cwksp_reserve_aligned | ( | ZSTD_cwksp * | ws, |
size_t | bytes | ||
) |
Reserves and returns memory sized on and aligned on sizeof(unsigned).
Definition at line 270 of file zstd_cwksp.h.
Referenced by ZSTD_reset_matchState(), and ZSTD_resetCCtx_internal().
MEM_STATIC BYTE * ZSTD_cwksp_reserve_buffer | ( | ZSTD_cwksp * | ws, |
size_t | bytes | ||
) |
Reserves and returns unaligned memory.
Definition at line 263 of file zstd_cwksp.h.
Referenced by ZSTD_resetCCtx_internal().
MEM_STATIC int ZSTD_cwksp_reserve_failed | ( | const ZSTD_cwksp * | ws | ) |
Definition at line 486 of file zstd_cwksp.h.
Referenced by ZSTD_reset_matchState().
MEM_STATIC void * ZSTD_cwksp_reserve_internal | ( | ZSTD_cwksp * | ws, |
size_t | bytes, | ||
ZSTD_cwksp_alloc_phase_e | phase | ||
) |
Internal function. Do not use directly.
Definition at line 224 of file zstd_cwksp.h.
Referenced by ZSTD_cwksp_reserve_aligned(), and ZSTD_cwksp_reserve_buffer().
MEM_STATIC void * ZSTD_cwksp_reserve_object | ( | ZSTD_cwksp * | ws, |
size_t | bytes | ||
) |
Aligned on sizeof(void*).
Definition at line 309 of file zstd_cwksp.h.
Referenced by ZSTD_createCDict_advanced(), ZSTD_initCDict_internal(), ZSTD_initStaticCCtx(), ZSTD_initStaticCDict(), and ZSTD_resetCCtx_internal().
MEM_STATIC void * ZSTD_cwksp_reserve_table | ( | ZSTD_cwksp * | ws, |
size_t | bytes | ||
) |
Aligned on sizeof(unsigned). These buffers have the special property that their values remain constrained, allowing us to re-use them without memset()-ing them.
Definition at line 280 of file zstd_cwksp.h.
Referenced by ZSTD_reset_matchState().
MEM_STATIC size_t ZSTD_cwksp_sizeof | ( | const ZSTD_cwksp * | ws | ) |
Definition at line 482 of file zstd_cwksp.h.
Referenced by ZSTD_resetCCtx_internal(), ZSTD_sizeof_CCtx(), and ZSTD_sizeof_CDict().