Project Alice
Loading...
Searching...
No Matches
zstdmt_compress.c File Reference
Include dependency graph for zstdmt_compress.c:

Go to the source code of this file.

Classes

struct  buffer_s
 
struct  ZSTDMT_bufferPool_s
 
struct  ZSTDMT_CCtxPool
 
struct  range_t
 
struct  serialState_t
 
struct  ZSTDMT_jobDescription
 
struct  inBuff_t
 
struct  roundBuff_t
 
struct  rsyncState_t
 
struct  ZSTDMT_CCtx_s
 
struct  syncPoint_t
 

Macros

#define ZSTD_RESIZE_SEQPOOL   0
 
#define ZSTD_PTHREAD_MUTEX_LOCK(m)   ZSTD_pthread_mutex_lock(m)
 
#define DEBUG_PRINTHEX(l, p, n)   do { } while (0)
 
#define BUF_POOL_MAX_NB_BUFFERS(nbWorkers)   (2*(nbWorkers) + 3)
 
#define SEQ_POOL_MAX_NB_BUFFERS(nbWorkers)   (nbWorkers)
 
#define JOB_ERROR(e)
 
#define RSYNC_LENGTH   32
 
#define RSYNC_MIN_BLOCK_LOG   ZSTD_BLOCKSIZELOG_MAX
 
#define RSYNC_MIN_BLOCK_SIZE   (1<<RSYNC_MIN_BLOCK_LOG)
 

Typedefs

typedef struct buffer_s buffer_t
 
typedef struct ZSTDMT_bufferPool_s ZSTDMT_bufferPool
 
typedef ZSTDMT_bufferPool ZSTDMT_seqPool
 

Functions

MEM_STATIC ZSTDMT_CCtxZSTDMT_createCCtx_advanced_internal (unsigned nbWorkers, ZSTD_customMem cMem, ZSTD_threadPool *pool)
 
ZSTDMT_CCtxZSTDMT_createCCtx_advanced (unsigned nbWorkers, ZSTD_customMem cMem, ZSTD_threadPool *pool)
 
size_t ZSTDMT_freeCCtx (ZSTDMT_CCtx *mtctx)
 
size_t ZSTDMT_sizeof_CCtx (ZSTDMT_CCtx *mtctx)
 
void ZSTDMT_updateCParams_whileCompressing (ZSTDMT_CCtx *mtctx, const ZSTD_CCtx_params *cctxParams)
 
ZSTD_frameProgression ZSTDMT_getFrameProgression (ZSTDMT_CCtx *mtctx)
 
size_t ZSTDMT_toFlushNow (ZSTDMT_CCtx *mtctx)
 
size_t ZSTDMT_initCStream_internal (ZSTDMT_CCtx *mtctx, const void *dict, size_t dictSize, ZSTD_dictContentType_e dictContentType, const ZSTD_CDict *cdict, ZSTD_CCtx_params params, unsigned long long pledgedSrcSize)
 
size_t ZSTDMT_nextInputSizeHint (const ZSTDMT_CCtx *mtctx)
 
size_t ZSTDMT_compressStream_generic (ZSTDMT_CCtx *mtctx, ZSTD_outBuffer *output, ZSTD_inBuffer *input, ZSTD_EndDirective endOp)
 

Macro Definition Documentation

◆ BUF_POOL_MAX_NB_BUFFERS

#define BUF_POOL_MAX_NB_BUFFERS (   nbWorkers)    (2*(nbWorkers) + 3)

Definition at line 278 of file zstdmt_compress.c.

◆ DEBUG_PRINTHEX

#define DEBUG_PRINTHEX (   l,
  p,
 
)    do { } while (0)

Definition at line 82 of file zstdmt_compress.c.

◆ JOB_ERROR

#define JOB_ERROR (   e)
Value:
do { \
ZSTD_PTHREAD_MUTEX_LOCK(&job->job_mutex); \
job->cSize = e; \
ZSTD_pthread_mutex_unlock(&job->job_mutex); \
goto _endJob; \
} while (0)

Definition at line 674 of file zstdmt_compress.c.

◆ RSYNC_LENGTH

#define RSYNC_LENGTH   32

Definition at line 833 of file zstdmt_compress.c.

◆ RSYNC_MIN_BLOCK_LOG

#define RSYNC_MIN_BLOCK_LOG   ZSTD_BLOCKSIZELOG_MAX

Definition at line 841 of file zstdmt_compress.c.

◆ RSYNC_MIN_BLOCK_SIZE

#define RSYNC_MIN_BLOCK_SIZE   (1<<RSYNC_MIN_BLOCK_LOG)

Definition at line 842 of file zstdmt_compress.c.

◆ SEQ_POOL_MAX_NB_BUFFERS

#define SEQ_POOL_MAX_NB_BUFFERS (   nbWorkers)    (nbWorkers)

Definition at line 282 of file zstdmt_compress.c.

◆ ZSTD_PTHREAD_MUTEX_LOCK

#define ZSTD_PTHREAD_MUTEX_LOCK (   m)    ZSTD_pthread_mutex_lock(m)

Definition at line 81 of file zstdmt_compress.c.

◆ ZSTD_RESIZE_SEQPOOL

#define ZSTD_RESIZE_SEQPOOL   0

Definition at line 32 of file zstdmt_compress.c.

Typedef Documentation

◆ buffer_t

typedef struct buffer_s buffer_t

◆ ZSTDMT_bufferPool

◆ ZSTDMT_seqPool

Definition at line 286 of file zstdmt_compress.c.

Function Documentation

◆ ZSTDMT_compressStream_generic()

size_t ZSTDMT_compressStream_generic ( ZSTDMT_CCtx mtctx,
ZSTD_outBuffer output,
ZSTD_inBuffer input,
ZSTD_EndDirective  endOp 
)

ZSTDMT_compressStream_generic() : internal use only - exposed to be invoked from zstd_compress.c assumption : output and input are valid (pos <= size)

Returns
: minimum amount of data remaining to flush, 0 if none

Definition at line 1812 of file zstdmt_compress.c.

Here is the caller graph for this function:

◆ ZSTDMT_createCCtx_advanced()

ZSTDMT_CCtx * ZSTDMT_createCCtx_advanced ( unsigned  nbWorkers,
ZSTD_customMem  cMem,
ZSTD_threadPool *  pool 
)

Definition at line 976 of file zstdmt_compress.c.

Here is the call graph for this function:

◆ ZSTDMT_createCCtx_advanced_internal()

MEM_STATIC ZSTDMT_CCtx * ZSTDMT_createCCtx_advanced_internal ( unsigned  nbWorkers,
ZSTD_customMem  cMem,
ZSTD_threadPool *  pool 
)

Definition at line 934 of file zstdmt_compress.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ZSTDMT_freeCCtx()

size_t ZSTDMT_freeCCtx ( ZSTDMT_CCtx mtctx)

Definition at line 1028 of file zstdmt_compress.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ZSTDMT_getFrameProgression()

ZSTD_frameProgression ZSTDMT_getFrameProgression ( ZSTDMT_CCtx mtctx)

ZSTDMT_getFrameProgression(): tells how much data has been consumed (input) and produced (output) for current frame. able to count progression inside worker threads.

Definition at line 1097 of file zstdmt_compress.c.

Here is the caller graph for this function:

◆ ZSTDMT_initCStream_internal()

size_t ZSTDMT_initCStream_internal ( ZSTDMT_CCtx mtctx,
const void *  dict,
size_t  dictSize,
ZSTD_dictContentType_e  dictContentType,
const ZSTD_CDict cdict,
ZSTD_CCtx_params  params,
unsigned long long  pledgedSrcSize 
)

ZSTDMT_initCStream_internal() : Private use only. Init streaming operation. expects params to be valid. must receive dict, or cdict, or none, but not both. mtctx can be freshly constructed or reused from a prior compression. If mtctx is reused, memory allocations from the prior compression may not be freed, even if they are not needed for the current compression.

Returns
: 0, or an error code

Definition at line 1233 of file zstdmt_compress.c.

Here is the call graph for this function:

◆ ZSTDMT_nextInputSizeHint()

size_t ZSTDMT_nextInputSizeHint ( const ZSTDMT_CCtx mtctx)

Definition at line 1801 of file zstdmt_compress.c.

◆ ZSTDMT_sizeof_CCtx()

size_t ZSTDMT_sizeof_CCtx ( ZSTDMT_CCtx mtctx)

Definition at line 1046 of file zstdmt_compress.c.

Here is the call graph for this function:

◆ ZSTDMT_toFlushNow()

size_t ZSTDMT_toFlushNow ( ZSTDMT_CCtx mtctx)

ZSTDMT_toFlushNow() Tell how many bytes are ready to be flushed immediately. Probe the oldest active job (not yet entirely flushed) and check its output buffer. If return 0, it means there is no active job, or, it means oldest job is still active, but everything produced has been flushed so far, therefore flushing is limited by speed of oldest job.

Definition at line 1131 of file zstdmt_compress.c.

Here is the caller graph for this function:

◆ ZSTDMT_updateCParams_whileCompressing()

void ZSTDMT_updateCParams_whileCompressing ( ZSTDMT_CCtx mtctx,
const ZSTD_CCtx_params *  cctxParams 
)

ZSTDMT_updateCParams_whileCompressing() : Updates a selected set of compression parameters, remaining compatible with currently active frame. New parameters will be applied to next compression job.

Definition at line 1080 of file zstdmt_compress.c.

Here is the call graph for this function:
Here is the caller graph for this function: