Go to the source code of this file.
|
MEM_STATIC size_t | ZSTD_cwksp_available_space (ZSTD_cwksp *ws) |
|
MEM_STATIC void * | ZSTD_cwksp_initialAllocStart (ZSTD_cwksp *ws) |
|
MEM_STATIC void | ZSTD_cwksp_assert_internal_consistency (ZSTD_cwksp *ws) |
|
MEM_STATIC size_t | ZSTD_cwksp_align (size_t size, size_t const align) |
|
MEM_STATIC size_t | ZSTD_cwksp_alloc_size (size_t size) |
|
MEM_STATIC size_t | ZSTD_cwksp_aligned_alloc_size (size_t size) |
|
MEM_STATIC size_t | ZSTD_cwksp_slack_space_required (void) |
|
MEM_STATIC size_t | ZSTD_cwksp_bytes_to_align_ptr (void *ptr, const size_t alignBytes) |
|
MEM_STATIC void * | ZSTD_cwksp_reserve_internal_buffer_space (ZSTD_cwksp *ws, size_t const bytes) |
|
MEM_STATIC size_t | ZSTD_cwksp_internal_advance_phase (ZSTD_cwksp *ws, ZSTD_cwksp_alloc_phase_e phase) |
|
MEM_STATIC int | ZSTD_cwksp_owns_buffer (const ZSTD_cwksp *ws, const void *ptr) |
|
MEM_STATIC void * | ZSTD_cwksp_reserve_internal (ZSTD_cwksp *ws, size_t bytes, ZSTD_cwksp_alloc_phase_e phase) |
|
MEM_STATIC BYTE * | ZSTD_cwksp_reserve_buffer (ZSTD_cwksp *ws, size_t bytes) |
|
MEM_STATIC void * | ZSTD_cwksp_reserve_aligned_init_once (ZSTD_cwksp *ws, size_t bytes) |
|
MEM_STATIC void * | ZSTD_cwksp_reserve_aligned (ZSTD_cwksp *ws, size_t bytes) |
|
MEM_STATIC void * | ZSTD_cwksp_reserve_table (ZSTD_cwksp *ws, size_t bytes) |
|
MEM_STATIC void * | ZSTD_cwksp_reserve_object (ZSTD_cwksp *ws, size_t bytes) |
|
MEM_STATIC void | ZSTD_cwksp_mark_tables_dirty (ZSTD_cwksp *ws) |
|
MEM_STATIC void | ZSTD_cwksp_mark_tables_clean (ZSTD_cwksp *ws) |
|
MEM_STATIC void | ZSTD_cwksp_clean_tables (ZSTD_cwksp *ws) |
|
MEM_STATIC void | ZSTD_cwksp_clear_tables (ZSTD_cwksp *ws) |
|
MEM_STATIC void | ZSTD_cwksp_clear (ZSTD_cwksp *ws) |
|
MEM_STATIC size_t | ZSTD_cwksp_sizeof (const ZSTD_cwksp *ws) |
|
MEM_STATIC size_t | ZSTD_cwksp_used (const ZSTD_cwksp *ws) |
|
MEM_STATIC void | ZSTD_cwksp_init (ZSTD_cwksp *ws, void *start, size_t size, ZSTD_cwksp_static_alloc_e isStatic) |
|
MEM_STATIC size_t | ZSTD_cwksp_create (ZSTD_cwksp *ws, size_t size, ZSTD_customMem customMem) |
|
MEM_STATIC void | ZSTD_cwksp_free (ZSTD_cwksp *ws, ZSTD_customMem customMem) |
|
MEM_STATIC void | ZSTD_cwksp_move (ZSTD_cwksp *dst, ZSTD_cwksp *src) |
|
MEM_STATIC int | ZSTD_cwksp_reserve_failed (const ZSTD_cwksp *ws) |
|
MEM_STATIC int | ZSTD_cwksp_estimated_space_within_bounds (const ZSTD_cwksp *const ws, size_t const estimatedSpace) |
|
MEM_STATIC int | ZSTD_cwksp_check_available (ZSTD_cwksp *ws, size_t additionalNeededSpace) |
|
MEM_STATIC int | ZSTD_cwksp_check_too_large (ZSTD_cwksp *ws, size_t additionalNeededSpace) |
|
MEM_STATIC int | ZSTD_cwksp_check_wasteful (ZSTD_cwksp *ws, size_t additionalNeededSpace) |
|
MEM_STATIC void | ZSTD_cwksp_bump_oversized_duration (ZSTD_cwksp *ws, size_t additionalNeededSpace) |
|
◆ ZSTD_CWKSP_ALIGNMENT_BYTES
#define ZSTD_CWKSP_ALIGNMENT_BYTES 64 |
◆ ZSTD_CWKSP_ASAN_REDZONE_SIZE
#define ZSTD_CWKSP_ASAN_REDZONE_SIZE 128 |
◆ ZSTD_cwksp_alloc_phase_e
Enumerator |
---|
ZSTD_cwksp_alloc_objects | |
ZSTD_cwksp_alloc_aligned_init_once | |
ZSTD_cwksp_alloc_aligned | |
ZSTD_cwksp_alloc_buffers | |
◆ ZSTD_cwksp_static_alloc_e
Used to describe whether the workspace is statically allocated (and will not necessarily ever be freed), or if it's dynamically allocated and we can expect a well-formed caller to free this.
Enumerator |
---|
ZSTD_cwksp_dynamic_alloc | |
ZSTD_cwksp_static_alloc | |
◆ ZSTD_cwksp_align()
Align must be a power of 2.
◆ ZSTD_cwksp_aligned_alloc_size()
MEM_STATIC size_t ZSTD_cwksp_aligned_alloc_size |
( |
size_t | size | ) |
|
Returns an adjusted alloc size that is the nearest larger multiple of 64 bytes. Used to determine the number of bytes required for a given "aligned".
◆ ZSTD_cwksp_alloc_size()
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.
Do not use for sizing aligned buffers. Instead, use ZSTD_cwksp_aligned_alloc_size().
◆ ZSTD_cwksp_assert_internal_consistency()
◆ ZSTD_cwksp_available_space()
◆ ZSTD_cwksp_bump_oversized_duration()
MEM_STATIC void ZSTD_cwksp_bump_oversized_duration |
( |
ZSTD_cwksp * | ws, |
|
|
size_t | additionalNeededSpace ) |
◆ ZSTD_cwksp_bytes_to_align_ptr()
MEM_STATIC size_t ZSTD_cwksp_bytes_to_align_ptr |
( |
void * | ptr, |
|
|
const size_t | alignBytes ) |
Return the number of additional bytes required to align a pointer to the given number of bytes. alignBytes must be a power of two.
◆ ZSTD_cwksp_check_available()
◆ ZSTD_cwksp_check_too_large()
◆ ZSTD_cwksp_check_wasteful()
◆ ZSTD_cwksp_clean_tables()
Zero the part of the allocated tables not already marked clean.
◆ ZSTD_cwksp_clear()
Invalidates all buffer, aligned, and table allocations. Object allocations remain valid.
◆ ZSTD_cwksp_clear_tables()
Invalidates table allocations. All other allocations remain valid.
◆ ZSTD_cwksp_create()
◆ ZSTD_cwksp_estimated_space_within_bounds()
◆ ZSTD_cwksp_free()
◆ ZSTD_cwksp_init()
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).
◆ ZSTD_cwksp_initialAllocStart()
Returns the initial value for allocStart which is used to determine the position from which we can allocate from the end of the workspace.
◆ ZSTD_cwksp_internal_advance_phase()
Moves the cwksp to the next phase, and does any necessary allocations. cwksp initialization must necessarily go through each phase in order. Returns a 0 on success, or zstd error
◆ ZSTD_cwksp_mark_tables_clean()
◆ ZSTD_cwksp_mark_tables_dirty()
◆ ZSTD_cwksp_move()
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 it's used again).
◆ ZSTD_cwksp_owns_buffer()
Returns whether this object/buffer/etc was allocated in this workspace.
◆ ZSTD_cwksp_reserve_aligned()
Reserves and returns memory sized on and aligned on ZSTD_CWKSP_ALIGNMENT_BYTES (64 bytes).
◆ ZSTD_cwksp_reserve_aligned_init_once()
Reserves and returns memory sized on and aligned on ZSTD_CWKSP_ALIGNMENT_BYTES (64 bytes). This memory has been initialized at least once in the past. This doesn't mean it has been initialized this time, and it might contain data from previous operations. The main usage is for algorithms that might need read access into uninitialized memory. The algorithm must maintain safety under these conditions and must make sure it doesn't leak any of the past data (directly or in side channels).
◆ ZSTD_cwksp_reserve_buffer()
Reserves and returns unaligned memory.
◆ ZSTD_cwksp_reserve_failed()
◆ ZSTD_cwksp_reserve_internal()
Internal function. Do not use directly.
◆ ZSTD_cwksp_reserve_internal_buffer_space()
Internal function. Do not use directly. Reserves the given number of bytes within the aligned/buffer segment of the wksp, which counts from the end of the wksp (as opposed to the object/table segment).
Returns a pointer to the beginning of that space.
◆ ZSTD_cwksp_reserve_object()
Aligned on sizeof(void*). Note : should happen only once, at workspace first initialization
◆ ZSTD_cwksp_reserve_table()
Aligned on 64 bytes. These buffers have the special property that their values remain constrained, allowing us to reuse them without memset()-ing them.
◆ ZSTD_cwksp_sizeof()
◆ ZSTD_cwksp_slack_space_required()
MEM_STATIC size_t ZSTD_cwksp_slack_space_required |
( |
void | | ) |
|
Returns the amount of additional space the cwksp must allocate for internal purposes (currently only alignment).
◆ ZSTD_cwksp_used()