Lumiera 0.pre.04~rc.1
»edit your freedom«
Loading...
Searching...
No Matches
MemoryPool Class Reference

Description

registration and tracking of memory allocations handed out.

Definition at line 58 of file tracking-allocator.cpp.

Classes

struct  Allocation
 registration entry to maintain a single allocation More...
 
struct  LocationHash
 

Public Member Functions

 MemoryPool (Literal id)
 
AllocationaddAlloc (size_t bytes)
 
void discardAlloc (void *loc, size_t)
 
Allocation const * findAlloc (Location) const
 
HashVal getChecksum () const
 
size_t getAllocationCnt () const
 
size_t calcAllocSize () const
 
Literal getPoolID () const
 

Private Types

using Location = void *
 
using AllocTab = std::unordered_map< const Location, Allocation, LocationHash >
 

Private Attributes

Literal poolID_
 
AllocTab allocs_
 
HashVal checksum_
 
size_t entryNr_
 

Additional Inherited Members

- Private Member Functions inherited from NonCopyable
 ~NonCopyable ()=default
 
 NonCopyable ()=default
 
 NonCopyable (NonCopyable const &)=delete
 
NonCopyableoperator= (NonCopyable const &)=delete
 

Constructor & Destructor Documentation

◆ MemoryPool()

MemoryPool ( Literal  id)
inline

Definition at line 85 of file tracking-allocator.cpp.

Member Typedef Documentation

◆ Location

using Location = void*
private

Definition at line 62 of file tracking-allocator.cpp.

◆ AllocTab

using AllocTab = std::unordered_map<const Location, Allocation, LocationHash>
private

Definition at line 76 of file tracking-allocator.cpp.

Member Function Documentation

◆ addAlloc()

MemoryPool::Allocation & addAlloc ( size_t  bytes)

Definition at line 208 of file tracking-allocator.cpp.

References UninitialisedDynBlock< T >::allocate(), MemoryPool::allocs_, MemoryPool::Allocation::buff, MemoryPool::checksum_, MemoryPool::Allocation::entryID, MemoryPool::entryNr_, UninitialisedDynBlock< T >::front(), and MemoryPool::poolID_.

+ Here is the call graph for this function:

◆ discardAlloc()

void discardAlloc ( void *  loc,
size_t  bytes 
)

◆ findAlloc()

MemoryPool::Allocation const * findAlloc ( Location  loc) const

Definition at line 242 of file tracking-allocator.cpp.

References MemoryPool::allocs_.

◆ getChecksum()

HashVal getChecksum ( ) const

Definition at line 250 of file tracking-allocator.cpp.

References MemoryPool::checksum_.

◆ getAllocationCnt()

size_t getAllocationCnt ( ) const

Definition at line 256 of file tracking-allocator.cpp.

References MemoryPool::allocs_.

◆ calcAllocSize()

size_t calcAllocSize ( ) const

Definition at line 262 of file tracking-allocator.cpp.

References MemoryPool::allocs_, and lib::explore().

+ Here is the call graph for this function:

◆ getPoolID()

Literal getPoolID ( ) const
inline

Definition at line 101 of file tracking-allocator.cpp.

References MemoryPool::poolID_.

Member Data Documentation

◆ poolID_

Literal poolID_
private

◆ allocs_

◆ checksum_

HashVal checksum_
private

◆ entryNr_

size_t entryNr_
private

Definition at line 82 of file tracking-allocator.cpp.

Referenced by MemoryPool::addAlloc().

+ Inheritance diagram for MemoryPool:
+ Collaboration diagram for MemoryPool:

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