ReactOS 0.4.16-dev-122-g325d74c
|
#include <zstd_cwksp.h>
Public Attributes | |
void * | workspace |
void * | workspaceEnd |
void * | objectEnd |
void * | tableEnd |
void * | tableValidEnd |
void * | allocStart |
int | allocFailed |
int | workspaceOversizedDuration |
ZSTD_cwksp_alloc_phase_e | phase |
Zstd fits all its internal datastructures into a single continuous buffer, so that it only needs to perform a single OS allocation (or so that a buffer can be provided to it and it can perform no allocations at all). This buffer is called the workspace.
Several optimizations complicate that process of allocating memory ranges from this workspace for each internal datastructure:
To attempt to manage this buffer, given these constraints, the ZSTD_cwksp abstraction was created. It works as follows:
Workspace Layout:
[ ... workspace ... ] [objects][tables ... ->] free space [<- ... aligned][<- ... buffers]
The various objects that live in the workspace are divided into the following categories, and are allocated separately:
Allocating Memory:
The various types of objects must be allocated in order, so they can be correctly packed into the workspace buffer. That order is:
Attempts to reserve objects of different types out of order will fail.
Definition at line 131 of file zstd_cwksp.h.
int ZSTD_cwksp::allocFailed |
Definition at line 140 of file zstd_cwksp.h.
void* ZSTD_cwksp::allocStart |
Definition at line 138 of file zstd_cwksp.h.
void* ZSTD_cwksp::objectEnd |
Definition at line 135 of file zstd_cwksp.h.
ZSTD_cwksp_alloc_phase_e ZSTD_cwksp::phase |
Definition at line 142 of file zstd_cwksp.h.
void* ZSTD_cwksp::tableEnd |
Definition at line 136 of file zstd_cwksp.h.
void* ZSTD_cwksp::tableValidEnd |
Definition at line 137 of file zstd_cwksp.h.
void* ZSTD_cwksp::workspace |
Definition at line 132 of file zstd_cwksp.h.
Referenced by ZSTD_sizeof_CCtx(), and ZSTD_sizeof_CDict().
void* ZSTD_cwksp::workspaceEnd |
Definition at line 133 of file zstd_cwksp.h.
int ZSTD_cwksp::workspaceOversizedDuration |
Definition at line 141 of file zstd_cwksp.h.