gatb.core-API-0.0.0
IMemory Class Referenceabstract

Interface providing methods for dynamic allocation and memory statistics. More...

#include <IMemory.hpp>

Inheritance diagram for IMemory:
Inheritance graph

Public Member Functions

virtual size_t getNbBlocks ()=0
 
virtual TotalSize_t getCurrentUsage ()=0
 
virtual TotalSize_t getMaximumUsage ()=0
 
virtual ~IMemory ()
 
- Public Member Functions inherited from IMemoryAllocator
virtual void * malloc (BlockSize_t size)=0
 
virtual void * calloc (size_t nmemb, BlockSize_t size)=0
 
virtual void * realloc (void *ptr, BlockSize_t size)=0
 
virtual void free (void *ptr)=0
 
virtual ~IMemoryAllocator ()
 
- Public Member Functions inherited from IMemoryOperations
virtual void * memset (void *s, int c, size_t n)=0
 
virtual void * memcpy (void *dest, const void *src, size_t n)=0
 
virtual int memcmp (const void *s1, const void *s2, size_t n)=0
 
virtual ~IMemoryOperations ()
 

Additional Inherited Members

- Public Types inherited from IMemoryAllocator
typedef u_int64_t BlockSize_t
 
typedef u_int64_t TotalSize_t
 

Detailed Description

Interface providing methods for dynamic allocation and memory statistics.

This interface provides most common methods for creating/deleting dynamic allocation buffers.

It also provides information about its inner state (current memory usage, maximum reached).

Specific implementations could be:

  • system allocator (ie. functions from stdlib.h)
  • allocator with a maximum allowed total size
  • etc...

Constructor & Destructor Documentation

virtual ~IMemory ( )
inlinevirtual

Destructor.

Member Function Documentation

virtual TotalSize_t getCurrentUsage ( )
pure virtual

Get the memory usage by the current process.

Returns
the memory usage (in bytes).

Implemented in MemoryCommon.

virtual TotalSize_t getMaximumUsage ( )
pure virtual

Get the maximum reached size.

Returns
the maximum used memory (in bytes).

Implemented in MemoryCommon.

virtual size_t getNbBlocks ( )
pure virtual

Get the number of currently allocated memory blocks.

Returns
the number of allocated blocks.

Implemented in MemoryCommon.


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