tlds
Transactional Operations for Linked Data Structures
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
memory.c File Reference
#include <assert.h>
#include <stdlib.h>
#include "memory.h"
#include "types.h"
Include dependency graph for memory.c:

Classes

struct  block
 
struct  pool
 
struct  memory
 

Macros

#define PADDING_SIZE   8
 

Typedefs

typedef struct block block_t
 
typedef struct pool pool_t
 

Functions

static block_tallocBlock (size_t capacity)
 
static void freeBlock (block_t *blockPtr)
 
static pool_tallocPool (size_t initBlockCapacity, long blockGrowthFactor)
 
static void freeBlocks (block_t *blockPtr)
 
static void freePool (pool_t *poolPtr)
 
bool_t memory_init (long numThread, size_t initBlockCapacity, long blockGrowthFactor)
 
void memory_destroy (void)
 
static block_taddBlockToPool (pool_t *poolPtr, long numByte)
 
static void * getMemoryFromBlock (block_t *blockPtr, size_t numByte)
 
static void * getMemoryFromPool (pool_t *poolPtr, size_t numByte)
 
void * memory_get (long threadId, size_t numByte)
 

Variables

memory_tglobal_memoryPtr = 0
 

Macro Definition Documentation

#define PADDING_SIZE   8

Typedef Documentation

typedef struct block block_t
typedef struct pool pool_t

Function Documentation

static block_t* addBlockToPool ( pool_t poolPtr,
long  numByte 
)
static

Here is the call graph for this function:

Here is the caller graph for this function:

static block_t* allocBlock ( size_t  capacity)
static

Here is the caller graph for this function:

static pool_t* allocPool ( size_t  initBlockCapacity,
long  blockGrowthFactor 
)
static

Here is the call graph for this function:

Here is the caller graph for this function:

static void freeBlock ( block_t blockPtr)
static

Here is the caller graph for this function:

static void freeBlocks ( block_t blockPtr)
static

Here is the call graph for this function:

Here is the caller graph for this function:

static void freePool ( pool_t poolPtr)
static

Here is the call graph for this function:

Here is the caller graph for this function:

static void* getMemoryFromBlock ( block_t blockPtr,
size_t  numByte 
)
static

Here is the caller graph for this function:

static void* getMemoryFromPool ( pool_t poolPtr,
size_t  numByte 
)
static

Here is the call graph for this function:

Here is the caller graph for this function:

void memory_destroy ( void  )

Here is the call graph for this function:

void* memory_get ( long  threadId,
size_t  numByte 
)

Here is the call graph for this function:

bool_t memory_init ( long  numThread,
size_t  initBlockCapacity,
long  blockGrowthFactor 
)

Here is the call graph for this function:

Variable Documentation

memory_t* global_memoryPtr = 0