 |
NVMLib
very early alpha
A library to optimally use a Hybrid RAM setup.
|
Go to the documentation of this file.
21 #include <libiberty/splay-tree.h>
55 #define __FILENAME__ (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
56 #define NUMARGS(...) (sizeof((int[]){0, ##__VA_ARGS__})/sizeof(int)-1)
61 MEMoidKey _memalloc(
size_t size,
const char *file,
const char *func,
const int line,
int num_args, ...);
78 #define memalloc(size, ...) _memalloc(size, __FILENAME__, __func__, __LINE__, NUMARGS(__VA_ARGS__), ##__VA_ARGS__)
88 #define KEY_FIRST(key) (_key_get_first(key))
89 #define KEY_LAST(key) (_key_get_last(key))
108 #define memfree(o) _memfree((o).oidkey)
126 #endif // !__NVM_MALLOC__
splay_tree addr2MemOID_write
uint64_t allot_first_free_offset_pool(uint64_t pool_id, size_t size)
Allocates first free memory chunk of the given size in the given pool specified by pool_id.
void * get_memobj_direct(MEMoid obj)
The function to return the actual memptr for a given MEMoid object.
struct addr2memoid_key addr2memoid_key
The structure used in spaly_tree which used for getting MEMoid from the memory address.
void * _key_get_last(MEMoidKey key)
struct MEMoid_st MEMoid
The struct that stores the memptr for the object.
The struct that stores the memptr for the object.
uint64_t MEMoidKey
The key of the HashTable that contains <MEMoidKey, MEMoid>.
void _memfree(MEMoidKey oidkey)
The fucntion to free the allocated memory location.
MEMoidKey _memalloc(size_t size, const char *file, const char *func, const int line, int num_args,...)
Allocates the memory requested and returns a MEMoidKey.
static const MEMoid MEMOID_NULL
Just a dummy obj.
splay_tree addr2MemOID_read
void * _key_get_first(MEMoidKey key)
The structure used in spaly_tree which used for getting MEMoid from the memory address.
MEMoid allot_first_free_offset(size_t size)
Allocates the first free memory chunk of the given size.