The Pedigree Project  0.1
Classes | Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes | Static Private Attributes | List of all members
SlamAllocator Class Reference
+ Collaboration diagram for SlamAllocator:

Classes

struct  AllocFooter
 
struct  AllocHeader
 

Public Member Functions

void initialise ()
 
uintptr_t allocate (size_t nBytes)
 
void free (uintptr_t mem)
 
size_t recovery (size_t maxSlabs=1)
 
bool isPointerValid (uintptr_t mem) const
 
bool isWithinHeap (uintptr_t mem) const
 
size_t allocSize (uintptr_t mem)
 
size_t heapPageCount () const
 
uintptr_t getSlab (size_t fullSize)
 
void freeSlab (uintptr_t address, size_t length)
 
void setVigilance (bool b)
 
bool getVigilance () const
 
struct SlamAllocator::AllocHeader __attribute__ ((aligned(16)))
 
struct SlamAllocator::AllocFooter __attribute__ ((aligned(16)))
 

Static Public Member Functions

static SlamAllocatorinstance ()
 

Private Member Functions

 SlamAllocator (const SlamAllocator &)
 
const SlamAllocatoroperator= (const SlamAllocator &)
 
void wipe ()
 

Private Attributes

SlamCache m_Caches [32]
 
bool m_bInitialised
 
bool m_bVigilant
 
Spinlock m_SlabRegionLock
 
size_t m_HeapPageCount
 
uint64_t * m_SlabRegionBitmap
 
size_t m_SlabRegionBitmapEntries
 
uintptr_t m_Base
 

Static Private Attributes

static EXPORTED_PUBLIC SlamAllocator m_Instance
 

Detailed Description

Definition at line 237 of file SlamAllocator.h.

Member Function Documentation

uintptr_t SlamAllocator::allocate ( size_t  nBytes)
Note
Even 2G is a stretch on most systems. Use some other allocator to allocate such large buffers.

Definition at line 1188 of file SlamAllocator.cc.

References assert, Dec, ERROR, SlamCache::free(), Thread::getParent(), Hex, Processor::information(), SlamCache::initialise(), Processor::m_Initialised, Backtrace::m_pReturnAddresses, Backtrace::performBpBacktrace(), UNLIKELY, and WARNING.

void SlamAllocator::wipe ( )
private

Member Data Documentation

SlamAllocator SlamAllocator::m_Instance
staticprivate
Todo:
why does a module access this!?

Definition at line 308 of file SlamAllocator.h.


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