NVMLib  very early alpha
A library to optimally use a Hybrid RAM setup.
pool.h File Reference
#include "globals.h"
#include "free_slot_list.h"
#include "hashmap.h"
#include <libpmemobj.h>
Include dependency graph for pool.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  pool_free_slot
 
struct  pool_free_slots_root
 
struct  pool_kv_st
 
struct  pool_free_slot_val_st
 

Macros

#define POOL_ID_MALLOC_OBJ   -1
 
#define POOL_SIZE   (2 << 12)
 

Typedefs

typedef struct pool_free_slot pool_free_slot
 
typedef struct pool_free_slot_head pool_free_slot_head
 
typedef struct pool_free_slots_root pool_free_slots_root
 
typedef struct pool_kv_st pool_kv
 
typedef struct pool_free_slot_val_st pool_free_slot_val
 

Functions

 POBJ_LAYOUT_BEGIN (free_slot_layout)
 
 POBJ_LAYOUT_ROOT (free_slot_layout, struct pool_free_slots_root)
 
 POBJ_LAYOUT_TOID (free_slot_layout, struct pool_free_slot)
 
 POBJ_LAYOUT_END (free_slot_layout)
 
 POBJ_TAILQ_HEAD (pool_free_slot_head, struct pool_free_slot)
 
 DECLARE_HASHMAP (pool_free_slot_val)
 
 HASH_MAP (pool_kv) *pool_map
 
 HASH_MAP (pool_free_slot_val) *pool_free_slot_map
 
int initialize_pool ()
 
uintptr_t get_pool_from_poolid (uint64_t pool_id)
 
uint64_t get_current_poolid ()
 
uint64_t get_first_free_offset (size_t size)
 
void nvm_free (uint64_t pool_id, uint64_t offset, size_t size)
 
void create_new_pool (size_t size)
 

Variables

uint32_t num_pools
 

Macro Definition Documentation

◆ POOL_ID_MALLOC_OBJ

#define POOL_ID_MALLOC_OBJ   -1

Definition at line 10 of file pool.h.

◆ POOL_SIZE

#define POOL_SIZE   (2 << 12)

Definition at line 12 of file pool.h.

Typedef Documentation

◆ pool_free_slot

◆ pool_free_slot_head

Definition at line 25 of file pool.h.

◆ pool_free_slot_val

◆ pool_free_slots_root

◆ pool_kv

typedef struct pool_kv_st pool_kv

Function Documentation

◆ create_new_pool()

void create_new_pool ( size_t  size)

Definition at line 94 of file pool.c.

Here is the call graph for this function:

◆ DECLARE_HASHMAP()

DECLARE_HASHMAP ( pool_free_slot_val  )

◆ get_current_poolid()

uint64_t get_current_poolid ( )

Definition at line 90 of file pool.c.

◆ get_first_free_offset()

uint64_t get_first_free_offset ( size_t  size)

◆ get_pool_from_poolid()

uintptr_t get_pool_from_poolid ( uint64_t  pool_id)

Definition at line 79 of file pool.c.

◆ HASH_MAP() [1/2]

HASH_MAP ( pool_free_slot_val  )

◆ HASH_MAP() [2/2]

HASH_MAP ( pool_kv  )

Definition at line 33 of file pool.c.

Here is the call graph for this function:

◆ initialize_pool()

int initialize_pool ( )

◆ nvm_free()

void nvm_free ( uint64_t  pool_id,
uint64_t  offset,
size_t  size 
)

Flag : 1 – to remove node 2 – to insert node

Definition at line 137 of file pool.c.

Here is the call graph for this function:

◆ POBJ_LAYOUT_BEGIN()

POBJ_LAYOUT_BEGIN ( free_slot_layout  )

◆ POBJ_LAYOUT_END()

POBJ_LAYOUT_END ( free_slot_layout  )

◆ POBJ_LAYOUT_ROOT()

POBJ_LAYOUT_ROOT ( free_slot_layout  ,
struct pool_free_slots_root   
)

◆ POBJ_LAYOUT_TOID()

POBJ_LAYOUT_TOID ( free_slot_layout  ,
struct pool_free_slot   
)

◆ POBJ_TAILQ_HEAD()

POBJ_TAILQ_HEAD ( pool_free_slot_head  ,
struct pool_free_slot   
)

Variable Documentation

◆ num_pools

uint32_t num_pools

Definition at line 13 of file pool.h.