Hermes  0.9.5-beta
Hierarchical Distributed I/O Buffering System
memory_management.cc File Reference
#include "memory_management.h"
#include <cmath>
Include dependency graph for memory_management.cc:
This graph shows which files directly or indirectly include this file:

Namespaces

 hermes
 

Functions

bool hermes::IsPowerOfTwo (size_t val)
 
uintptr_t hermes::AlignForward (uintptr_t addr, size_t alignment)
 
uintptr_t hermes::AlignBackward (uintptr_t addr, size_t alignment)
 
void hermes::InitArena (Arena *arena, size_t bytes, u8 *base)
 
Arena hermes::InitArenaAndAllocate (size_t bytes)
 
void hermes::DestroyArena (Arena *arena)
 
size_t hermes::GetRemainingCapacity (Arena *arena)
 
void hermes::GrowArena (Arena *arena, size_t new_size)
 The maximum capacity of arena becomes new_size. More...
 
TemporaryMemory hermes::BeginTemporaryMemory (Arena *arena)
 
void hermes::EndTemporaryMemory (TemporaryMemory *temp_memory)
 
u8 * hermes::PushSize (Arena *arena, size_t size, size_t alignment)
 
u8 * hermes::PushSizeAndClear (Arena *arena, size_t size, size_t alignment)
 
u8 * hermes::GetHeapMemory (Heap *heap)
 
FreeBlock * hermes::GetHeapFreeList (Heap *heap)
 
FreeBlock * hermes::NextFreeBlock (Heap *heap, FreeBlock *block)
 
u8 * hermes::HeapOffsetToPtr (Heap *heap, u32 offset)
 
u32 hermes::GetHeapOffset (Heap *heap, u8 *ptr)
 
void hermes::HeapErrorHandler ()
 
u32 hermes::ComputeHeapExtent (Heap *heap, void *item, u32 size)
 
u8 * hermes::HeapExtentToPtr (Heap *heap)
 
Heap * hermes::InitHeapInArena (Arena *arena, bool grows_up, u16 alignment)
 
FreeBlock * hermes::FindFirstFit (Heap *heap, u32 desired_size)
 
u8 * hermes::HeapPushSize (Heap *heap, u32 size)
 
void hermes::HeapFree (Heap *heap, void *ptr)
 
void * hermes::HeapRealloc (Heap *heap, void *ptr, size_t size)
 
void hermes::CoalesceFreeBlocks (Heap *heap)
 
Ticket hermes::TryBeginTicketMutex (TicketMutex *mutex, Ticket *existing_ticket)
 
void hermes::BeginTicketMutex (TicketMutex *mutex)
 
void hermes::EndTicketMutex (TicketMutex *mutex)
 
bool hermes::BeginReaderLock (RwLock *lock)
 
void hermes::EndReaderLock (RwLock *lock)
 
void hermes::BeginWriterLock (RwLock *lock)
 
void hermes::EndWriterLock (RwLock *lock)
 

Variables

const int hermes::kAttemptsBeforeYield = 100
 

Detailed Description

Basic Arena implementation.