A platform for high-performance distributed tool and library development written in C++. It can be deployed in two different cluster modes: standalone or distributed. API for v0.5.0, released on June 13, 2018.
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
SharedMem Class Reference

#include <SharedMem.h>

+ Collaboration diagram for SharedMem:

Public Member Functions

 SharedMem (size_t shmMemSize, pdb::PDBLoggerPtr logger)
 
 ~SharedMem ()
 
void lock ()
 
void unlock ()
 
void * malloc (size_t size)
 
void * mallocAlign (size_t size, size_t alignment, int &offset)
 
void free (void *ptr, size_t size)
 
long long computeOffset (void *shmAddress)
 
void * getPointer (size_t offset)
 
void * _malloc_unsafe (size_t size)
 
void _free_unsafe (void *ptr, size_t size)
 
size_t getShmSize ()
 

Static Public Member Functions

static char * addressRoundUp (char *address, size_t roundTo)
 
static size_t roundUp (size_t size, size_t roundTo)
 
static size_t roundDown (size_t size, size_t roundTo)
 

Protected Member Functions

int initialize ()
 
void destroy ()
 
int getMem ()
 
int initMallocs ()
 
int initMutex ()
 

Private Attributes

pthread_mutex_t * memLock
 
pdb::PDBLoggerPtr logger
 
tlsfAllocator allocator
 
void * my_tlsf
 
void * memPool
 
size_t shmMemSize
 

Detailed Description

Definition at line 39 of file SharedMem.h.

Constructor & Destructor Documentation

SharedMem::SharedMem ( size_t  shmMemSize,
pdb::PDBLoggerPtr  logger 
)

Definition at line 38 of file SharedMem.cc.

+ Here is the call graph for this function:

SharedMem::~SharedMem ( )

Definition at line 58 of file SharedMem.cc.

+ Here is the call graph for this function:

Member Function Documentation

void SharedMem::_free_unsafe ( void *  ptr,
size_t  size 
)

Definition at line 180 of file SharedMem.cc.

+ Here is the call graph for this function:

void * SharedMem::_malloc_unsafe ( size_t  size)

Definition at line 172 of file SharedMem.cc.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

char * SharedMem::addressRoundUp ( char *  address,
size_t  roundTo 
)
static

Definition at line 111 of file SharedMem.cc.

+ Here is the caller graph for this function:

long long SharedMem::computeOffset ( void *  shmAddress)

Definition at line 152 of file SharedMem.cc.

void SharedMem::destroy ( )
protected

Definition at line 131 of file SharedMem.cc.

+ Here is the caller graph for this function:

void SharedMem::free ( void *  ptr,
size_t  size 
)

Definition at line 100 of file SharedMem.cc.

+ Here is the call graph for this function:

int SharedMem::getMem ( )
protected

Definition at line 141 of file SharedMem.cc.

+ Here is the caller graph for this function:

void * SharedMem::getPointer ( size_t  offset)

Definition at line 156 of file SharedMem.cc.

size_t SharedMem::getShmSize ( )

Definition at line 70 of file SharedMem.cc.

int SharedMem::initialize ( )
protected

Definition at line 127 of file SharedMem.cc.

int SharedMem::initMallocs ( )
protected
int SharedMem::initMutex ( )
protected

Definition at line 160 of file SharedMem.cc.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void SharedMem::lock ( )

Definition at line 62 of file SharedMem.cc.

+ Here is the caller graph for this function:

void * SharedMem::malloc ( size_t  size)

Definition at line 75 of file SharedMem.cc.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void * SharedMem::mallocAlign ( size_t  size,
size_t  alignment,
int &  offset 
)

Definition at line 88 of file SharedMem.cc.

+ Here is the call graph for this function:

size_t SharedMem::roundDown ( size_t  size,
size_t  roundTo 
)
static

Definition at line 121 of file SharedMem.cc.

size_t SharedMem::roundUp ( size_t  size,
size_t  roundTo 
)
static

Definition at line 116 of file SharedMem.cc.

void SharedMem::unlock ( )

Definition at line 66 of file SharedMem.cc.

+ Here is the caller graph for this function:

Member Data Documentation

tlsfAllocator SharedMem::allocator
private

Definition at line 70 of file SharedMem.h.

pdb::PDBLoggerPtr SharedMem::logger
private

Definition at line 66 of file SharedMem.h.

pthread_mutex_t* SharedMem::memLock
private

Definition at line 65 of file SharedMem.h.

void* SharedMem::memPool
private

Definition at line 73 of file SharedMem.h.

void* SharedMem::my_tlsf
private

Definition at line 71 of file SharedMem.h.

size_t SharedMem::shmMemSize
private

Definition at line 74 of file SharedMem.h.


The documentation for this class was generated from the following files: