gatb.core-API-0.0.0
|
common implementation of IMemory interface More...
#include <MemoryCommon.hpp>
Public Member Functions | |
MemoryCommon (IMemoryAllocator &alloc, IMemoryOperations &ope) | |
void * | malloc (BlockSize_t size) |
void * | calloc (size_t nmemb, BlockSize_t size) |
void * | realloc (void *ptr, BlockSize_t size) |
void | free (void *ptr) |
void * | memset (void *s, int c, size_t n) |
void * | memcpy (void *dest, const void *src, size_t n) |
int | memcmp (const void *s1, const void *s2, size_t n) |
size_t | getNbBlocks () |
TotalSize_t | getCurrentUsage () |
TotalSize_t | getMaximumUsage () |
Public Member Functions inherited from IMemory | |
virtual | ~IMemory () |
Public Member Functions inherited from IMemoryAllocator | |
virtual | ~IMemoryAllocator () |
Public Member Functions inherited from IMemoryOperations | |
virtual | ~IMemoryOperations () |
Additional Inherited Members | |
Public Types inherited from IMemoryAllocator | |
typedef u_int64_t | BlockSize_t |
typedef u_int64_t | TotalSize_t |
common implementation of IMemory interface
This implementation delegates the allocation part to a referred IMemoryAllocator instance.
It is not abstract since it implements the statistics methods but with dummy return values. It could have sense in case we want fast allocators without statistic information.
Its main purpose is to factorize some code for concrete implementations.
|
inline |
Constructor.
[in] | alloc | : the referred memory allocator. |
[in] | ope | : the referred memory operations. |
|
inlinevirtual |
See calloc documentation.
Implements IMemoryAllocator.
|
inlinevirtual |
See free documentation.
Implements IMemoryAllocator.
|
inlinevirtual |
Get the memory usage by the current process.
Implements IMemory.
|
inlinevirtual |
|
inlinevirtual |
Get the number of currently allocated memory blocks.
Implements IMemory.
|
inlinevirtual |
See malloc documentation.
Implements IMemoryAllocator.
|
inlinevirtual |
Same as memcpy from <string.h>
Implements IMemoryOperations.
|
inlinevirtual |
Same as memcpy from <string.h>
Implements IMemoryOperations.
|
inlinevirtual |
Same as memset from <string.h>
Implements IMemoryOperations.
|
inlinevirtual |
See realloc documentation.
Implements IMemoryAllocator.