CX Framework
Cross-platform C utility framework
Loading...
Searching...
No Matches
scratch.h File Reference

Thread-local rotating scratch buffers for temporary storage. More...

#include <cx/cx.h>
#include <cx/thread/tlscleanup.h>
#include <cx/utils/compare.h>

Go to the source code of this file.

Data Structures

struct  ScratchPerThreadInfo
 Per-thread scratch buffer state. More...
 

Macros

#define SCRATCH_NBUFFERS   32
 Number of rotating buffers per thread (must be power of 2)
 
#define SCRATCH_MIN_BUFFER_SIZE   64
 Minimum size for scratch buffer allocations.
 
#define SCRATCH_MAX_REASONABLE_BUFFER_SIZE   1024
 Maximum size before buffer is considered unreasonably large.
 

Typedefs

typedef struct ScratchPerThreadInfo ScratchPerThreadInfo
 Per-thread scratch buffer state.
 

Functions

void * scratchGet (size_t sz)
 

Detailed Description

Thread-local rotating scratch buffers for temporary storage.

Definition in file scratch.h.