Public Attributes | List of all members
ZSTD_cwksp Struct Reference

Public Attributes

BYTE allocFailed
 
void * allocStart
 
void * initOnceStart
 
ZSTD_cwksp_static_alloc_e isStatic
 
void * objectEnd
 
ZSTD_cwksp_alloc_phase_e phase
 
void * tableEnd
 
void * tableValidEnd
 
void * workspace
 
void * workspaceEnd
 
int workspaceOversizedDuration
 

Detailed Description

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 [<- buffers][<- aligned][<- init once]

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:

  1. Objects
  2. Init once / Tables
  3. Aligned / Tables
  4. Buffers / Tables

Attempts to reserve objects of different types out of order will fail.

Definition at line 13693 of file zstd.c.

Member Data Documentation

◆ allocFailed

BYTE ZSTD_cwksp::allocFailed

Definition at line 13703 of file zstd.c.

◆ allocStart

void* ZSTD_cwksp::allocStart

Definition at line 13700 of file zstd.c.

◆ initOnceStart

void* ZSTD_cwksp::initOnceStart

Definition at line 13701 of file zstd.c.

◆ isStatic

ZSTD_cwksp_static_alloc_e ZSTD_cwksp::isStatic

Definition at line 13706 of file zstd.c.

◆ objectEnd

void* ZSTD_cwksp::objectEnd

Definition at line 13697 of file zstd.c.

◆ phase

ZSTD_cwksp_alloc_phase_e ZSTD_cwksp::phase

Definition at line 13705 of file zstd.c.

◆ tableEnd

void* ZSTD_cwksp::tableEnd

Definition at line 13698 of file zstd.c.

◆ tableValidEnd

void* ZSTD_cwksp::tableValidEnd

Definition at line 13699 of file zstd.c.

◆ workspace

void* ZSTD_cwksp::workspace

Definition at line 13694 of file zstd.c.

◆ workspaceEnd

void* ZSTD_cwksp::workspaceEnd

Definition at line 13695 of file zstd.c.

◆ workspaceOversizedDuration

int ZSTD_cwksp::workspaceOversizedDuration

Definition at line 13704 of file zstd.c.


The documentation for this struct was generated from the following file:


plotjuggler
Author(s): Davide Faconti
autogenerated on Mon Nov 11 2024 03:23:51