LispBM
Macros | Functions
lbm_defrag_mem.c File Reference
#include <lbm_defrag_mem.h>
#include <heap.h>
#include <lbm_memory.h>
Include dependency graph for lbm_defrag_mem.c:

Macros

#define DEFRAG_MEM_HEADER_SIZE   2
 
#define DEFRAG_MEM_HEADER_BYTES   (2*sizeof(lbm_uint))
 
#define DEFRAG_MEM_DATA(X)   &(X)[DEFRAG_MEM_HEADER_SIZE];
 
#define DEFRAG_MEM_SIZE(X)   X[0]
 
#define DEFRAG_MEM_FLAGS(X)   X[1]
 
#define DEFRAG_ALLOC_SIZE(X)   X[0]
 
#define DEFRAG_ALLOC_DATA(X)   X[1]
 
#define DEFRAG_ALLOC_CELLPTR(X)   X[2]
 
#define INIT   0
 
#define FREE_LEN   1
 

Functions

static lbm_uint bs2ws (lbm_uint bs)
 
lbm_value lbm_defrag_mem_create (lbm_uint nbytes)
 
static void free_defrag_allocation (lbm_uint *allocation)
 
void lbm_defrag_mem_destroy (lbm_uint *defrag_mem)
 
static void lbm_defrag_mem_defrag (lbm_uint *defrag_mem, lbm_uint bytes)
 
lbm_value lbm_defrag_mem_alloc_internal (lbm_uint *defrag_mem, lbm_uint bytes)
 
lbm_value lbm_defrag_mem_alloc (lbm_uint *defrag_mem, lbm_uint bytes)
 
void lbm_defrag_mem_free (lbm_uint *data)
 

Macro Definition Documentation

◆ DEFRAG_ALLOC_CELLPTR

#define DEFRAG_ALLOC_CELLPTR (   X)    X[2]

◆ DEFRAG_ALLOC_DATA

#define DEFRAG_ALLOC_DATA (   X)    X[1]

◆ DEFRAG_ALLOC_SIZE

#define DEFRAG_ALLOC_SIZE (   X)    X[0]

◆ DEFRAG_MEM_DATA

#define DEFRAG_MEM_DATA (   X)    &(X)[DEFRAG_MEM_HEADER_SIZE];

◆ DEFRAG_MEM_FLAGS

#define DEFRAG_MEM_FLAGS (   X)    X[1]

◆ DEFRAG_MEM_HEADER_BYTES

#define DEFRAG_MEM_HEADER_BYTES   (2*sizeof(lbm_uint))

◆ DEFRAG_MEM_HEADER_SIZE

#define DEFRAG_MEM_HEADER_SIZE   2

◆ DEFRAG_MEM_SIZE

#define DEFRAG_MEM_SIZE (   X)    X[0]

◆ FREE_LEN

#define FREE_LEN   1

◆ INIT

#define INIT   0

Function Documentation

◆ bs2ws()

static lbm_uint bs2ws ( lbm_uint  bs)
inlinestatic

◆ free_defrag_allocation()

static void free_defrag_allocation ( lbm_uint allocation)
static

◆ lbm_defrag_mem_alloc()

lbm_value lbm_defrag_mem_alloc ( lbm_uint defrag_mem,
lbm_uint  bytes 
)

◆ lbm_defrag_mem_alloc_internal()

lbm_value lbm_defrag_mem_alloc_internal ( lbm_uint defrag_mem,
lbm_uint  bytes 
)

◆ lbm_defrag_mem_create()

lbm_value lbm_defrag_mem_create ( lbm_uint  nbytes)

◆ lbm_defrag_mem_defrag()

static void lbm_defrag_mem_defrag ( lbm_uint defrag_mem,
lbm_uint  bytes 
)
static

◆ lbm_defrag_mem_destroy()

void lbm_defrag_mem_destroy ( lbm_uint defrag_mem)

◆ lbm_defrag_mem_free()

void lbm_defrag_mem_free ( lbm_uint data)