OPIC
Object Persistence In C
Macros | Typedefs | Functions
op_malloc.h File Reference

Go to the source code of this file.

Macros

#define OPHEAP_BITS   36
 Size of OPHeap represented in bits.
 
#define OPHEAP_SIZE   (1UL << OPHEAP_BITS)
 Size of OPHeap.
 
#define OPLENREF_MAX_LEN   (1ULL << (64 - OPHEAP_BITS))
 Maximum size oplenref_t can hold. More...
 

Typedefs

typedef uintptr_t opref_t
 The "pointer type" used within objects created by OPHeap. More...
 
typedef uintptr_t oplenref_t
 Another "pointer type" used within objects created in OPHeap. More...
 

Functions

static opref_t OPPtr2Ref (void *addr)
 Converts a pointer allocated in OPHeap to an opref_t. More...
 
static void * OPRef2Ptr (void *ptr_in_heap, opref_t ref)
 Converts an opref_t reference to a regular pointer. More...
 
static size_t OPLenRef2Size (oplenref_t ref)
 Obtain the size encoded in oplenref_t. More...
 
static void * OPLenRef2Ptr (oplenref_t *ref, size_t container_size)
 Converts an oplenref_t reference to a regular pointer. More...
 
static void * OPLenRef2PtrOnHeap (oplenref_t *ref, size_t container_size, OPHeap *heap)
 Converts an oplenref_t reference to a regular pointer on specified heap. More...
 
static void OPLenRefCreate (oplenref_t *ref, void *data, size_t data_size, size_t container_size)
 A constructor for oplenref_t to hold the input data. More...
 
static void OPLenRefDelete (oplenref_t *ref, size_t container_size)
 A destructor for oplenref_t. More...
 
static void OPLenRefRelpace (oplenref_t *ref, void *data, size_t data_size, size_t container_size)
 Relace the data stored in oplenref_t. More...
 

Detailed Description

Author
Felix Chern
Date
Sat Oct 1 20:12:46 2016 (-0700)

Definition in file op_malloc.h.