Parolin 0.7.9 6796
Console (soon DLLs) to do a tar like job
Loading...
Searching...
No Matches
memory.h File Reference
#include <string.h>
#include <brotli/types.h>
#include "../common/platform.h"

Go to the source code of this file.

Data Structures

struct  MemoryManager
 

Macros

#define BROTLI_ENCODER_EXIT_ON_OOM
 
#define BROTLI_ENCODER_MEMORY_MANAGER_SLOTS   0
 
#define BROTLI_ALLOC(M, T, N)
 
#define BROTLI_FREE(M, P)
 
#define BROTLI_IS_OOM(M)
 
#define BROTLI_IS_NULL(A)
 
#define BROTLI_ENSURE_CAPACITY(M, T, A, C, R)
 
#define BROTLI_ENSURE_CAPACITY_APPEND(M, T, A, C, S, V)
 

Typedefs

typedef struct MemoryManager MemoryManager
 

Functions

BROTLI_INTERNAL void BrotliInitMemoryManager (MemoryManager *m, brotli_alloc_func alloc_func, brotli_free_func free_func, void *opaque)
 
BROTLI_INTERNAL void * BrotliAllocate (MemoryManager *m, size_t n)
 
BROTLI_INTERNAL void BrotliFree (MemoryManager *m, void *p)
 
BROTLI_INTERNAL void BrotliWipeOutMemoryManager (MemoryManager *m)
 
BROTLI_INTERNAL void * BrotliBootstrapAlloc (size_t size, brotli_alloc_func alloc_func, brotli_free_func free_func, void *opaque)
 
BROTLI_INTERNAL void BrotliBootstrapFree (void *address, MemoryManager *m)
 

Macro Definition Documentation

◆ BROTLI_ALLOC

#define BROTLI_ALLOC ( M,
T,
N )
Value:
((N) > 0 ? ((T*)BrotliAllocate((M), (N) * sizeof(T))) : NULL)
BROTLI_INTERNAL void * BrotliAllocate(MemoryManager *m, size_t n)
Definition memory.c:52
#define NULL
Definition getopt1.c:37

◆ BROTLI_ENCODER_EXIT_ON_OOM

#define BROTLI_ENCODER_EXIT_ON_OOM

◆ BROTLI_ENCODER_MEMORY_MANAGER_SLOTS

#define BROTLI_ENCODER_MEMORY_MANAGER_SLOTS   0

◆ BROTLI_ENSURE_CAPACITY

#define BROTLI_ENSURE_CAPACITY ( M,
T,
A,
C,
R )
Value:
{ \
if (C < (R)) { \
size_t _new_size = (C == 0) ? (R) : C; \
T* new_array; \
while (_new_size < (R)) _new_size *= 2; \
new_array = BROTLI_ALLOC((M), T, _new_size); \
if (!BROTLI_IS_OOM(M) && !BROTLI_IS_NULL(new_array) && C != 0) \
memcpy(new_array, A, C * sizeof(T)); \
BROTLI_FREE((M), A); \
A = new_array; \
C = _new_size; \
} \
}
#define R(a)
Definition 7zCrcOpt.c:41
#define BROTLI_ALLOC(M, T, N)
Definition memory.h:44
#define BROTLI_IS_OOM(M)
Definition memory.h:54
#define BROTLI_IS_NULL(A)
Definition memory.h:68
#define A(x)
Definition crc_macros.h:23
#define C(x)
Definition crc_macros.h:25

◆ BROTLI_ENSURE_CAPACITY_APPEND

#define BROTLI_ENSURE_CAPACITY_APPEND ( M,
T,
A,
C,
S,
V )
Value:
{ \
(S)++; \
BROTLI_ENSURE_CAPACITY(M, T, A, C, S); \
A[(S) - 1] = (V); \
}
#define S(x, n)

◆ BROTLI_FREE

#define BROTLI_FREE ( M,
P )
Value:
{ \
BrotliFree((M), (P)); \
P = NULL; \
}
#define P(a, b, c, d, k, s, t)

◆ BROTLI_IS_NULL

#define BROTLI_IS_NULL ( A)
Value:
(!!0)

◆ BROTLI_IS_OOM

#define BROTLI_IS_OOM ( M)
Value:
(!!0)

Typedef Documentation

◆ MemoryManager

typedef struct MemoryManager MemoryManager

Function Documentation

◆ BrotliAllocate()

BROTLI_INTERNAL void * BrotliAllocate ( MemoryManager * m,
size_t n )

◆ BrotliBootstrapAlloc()

BROTLI_INTERNAL void * BrotliBootstrapAlloc ( size_t size,
brotli_alloc_func alloc_func,
brotli_free_func free_func,
void * opaque )

◆ BrotliBootstrapFree()

BROTLI_INTERNAL void BrotliBootstrapFree ( void * address,
MemoryManager * m )

◆ BrotliFree()

BROTLI_INTERNAL void BrotliFree ( MemoryManager * m,
void * p )

◆ BrotliInitMemoryManager()

BROTLI_INTERNAL void BrotliInitMemoryManager ( MemoryManager * m,
brotli_alloc_func alloc_func,
brotli_free_func free_func,
void * opaque )

◆ BrotliWipeOutMemoryManager()

BROTLI_INTERNAL void BrotliWipeOutMemoryManager ( MemoryManager * m)