#include <kingsley-alloc.h>
Classes | |
struct | Available |
struct | Mmap |
struct | MmapChunk |
Public Member Functions | |
KingsleyAlloc (void) | |
~KingsleyAlloc () | |
KingsleyAlloc * | Clone (void) |
void | Dispose () |
void | Free (uint8_t *buffer, uint32_t size) |
uint8_t * | Malloc (uint32_t size) |
uint8_t * | Realloc (uint8_t *oldBuffer, uint32_t oldSize, uint32_t newSize) |
void | SwitchTo (void) |
Private Member Functions | |
uint8_t * | Brk (uint32_t needed) |
uint32_t | BucketToSize (uint8_t bucket) |
void | MmapAlloc (uint32_t size) |
void | MmapFree (uint8_t *buffer, uint32_t size) |
uint8_t | SizeToBucket (uint32_t size) |
Private Attributes | |
struct Available * | m_buckets [32] |
std::list< struct KingsleyAlloc::MmapChunk > | m_chunks |
uint32_t | m_defaultMmapSize |
Definition at line 7 of file kingsley-alloc.h.
KingsleyAlloc::KingsleyAlloc | ( | void | ) |
Definition at line 29 of file kingsley-alloc.cc.
References m_buckets.
Referenced by Clone().
KingsleyAlloc::~KingsleyAlloc | ( | ) |
Definition at line 35 of file kingsley-alloc.cc.
References m_chunks, and MmapFree().
|
private |
Definition at line 166 of file kingsley-alloc.cc.
References m_chunks, m_defaultMmapSize, and MmapAlloc().
Referenced by Malloc().
|
private |
Definition at line 203 of file kingsley-alloc.cc.
Referenced by Malloc(), and SizeToBucket().
KingsleyAlloc * KingsleyAlloc::Clone | ( | void | ) |
Definition at line 84 of file kingsley-alloc.cc.
References KingsleyAlloc::Mmap::buffer, KingsleyAlloc::MmapChunk::copy, KingsleyAlloc::Mmap::current, KingsleyAlloc(), m_buckets, m_chunks, KingsleyAlloc::MmapChunk::mmap, KingsleyAlloc::Mmap::refcount, and KingsleyAlloc::Mmap::size.
Referenced by ns3::DceManager::Clone().
void KingsleyAlloc::Dispose | ( | ) |
Definition at line 70 of file kingsley-alloc.cc.
References m_chunks.
Referenced by ns3::DceManager::DeleteProcess(), and ns3::DceManager::Execve().
void KingsleyAlloc::Free | ( | uint8_t * | buffer, |
uint32_t | size | ||
) |
Definition at line 241 of file kingsley-alloc.cc.
References m_buckets, m_chunks, m_defaultMmapSize, MmapFree(), KingsleyAlloc::Available::next, REPORT_FREE, and SizeToBucket().
Referenced by Realloc().
uint8_t * KingsleyAlloc::Malloc | ( | uint32_t | size | ) |
Definition at line 210 of file kingsley-alloc.cc.
References Brk(), BucketToSize(), m_buckets, m_defaultMmapSize, MARK_DEFINED, MARK_UNDEFINED, MmapAlloc(), KingsleyAlloc::Available::next, REPORT_MALLOC, and SizeToBucket().
Referenced by Realloc().
|
private |
Definition at line 145 of file kingsley-alloc.cc.
References KingsleyAlloc::MmapChunk::brk, KingsleyAlloc::Mmap::buffer, KingsleyAlloc::MmapChunk::copy, KingsleyAlloc::Mmap::current, m_chunks, MARK_UNDEFINED, KingsleyAlloc::MmapChunk::mmap, KingsleyAlloc::Mmap::refcount, and KingsleyAlloc::Mmap::size.
Referenced by Brk(), and Malloc().
|
private |
Definition at line 137 of file kingsley-alloc.cc.
Referenced by Free(), and ~KingsleyAlloc().
uint8_t * KingsleyAlloc::Realloc | ( | uint8_t * | oldBuffer, |
uint32_t | oldSize, | ||
uint32_t | newSize | ||
) |
Definition at line 271 of file kingsley-alloc.cc.
References Free(), and Malloc().
|
private |
Definition at line 186 of file kingsley-alloc.cc.
References BucketToSize().
Referenced by Free(), and Malloc().
void KingsleyAlloc::SwitchTo | ( | void | ) |
Definition at line 112 of file kingsley-alloc.cc.
References KingsleyAlloc::Mmap::buffer, KingsleyAlloc::MmapChunk::copy, KingsleyAlloc::Mmap::current, m_chunks, KingsleyAlloc::MmapChunk::mmap, and KingsleyAlloc::Mmap::size.
Referenced by PthreadTaskSwitch(), and ns3::DceManager::TaskSwitch().
|
private |
Definition at line 51 of file kingsley-alloc.h.
Referenced by Clone(), Free(), KingsleyAlloc(), and Malloc().
|
private |
Definition at line 50 of file kingsley-alloc.h.
Referenced by Brk(), Clone(), Dispose(), Free(), MmapAlloc(), SwitchTo(), and ~KingsleyAlloc().
|
private |
Definition at line 52 of file kingsley-alloc.h.