Polaris: mem_manager.cc File Reference

mem_manager.cc File Reference

Go to the source code of this file.

Functions

static void initialize_memory_pool (void)
void flush_memory (void)
void remember_memory (void *ptr, unsigned int size)
 friend void* recall_memory( size_t size );
void * recall_memory (unsigned int size)
 void * recall_memory( size_t size );
void * pmalloc (int size)
void pfree (void *ptr)

Variables

static int initialize_pool = 1
static LargeStklarge_pool = 0
int _allocated_bytes = 0
int _total_alloc = 0
void * _top_address = 0


Function Documentation

static void initialize_memory_pool void   )  [static]
 

... The above statement uses calloc instead of operator new[] to ... avoid recording the allocation in HeapStats::objs class ... variable.

... call LargeStk CTOR on each element.

Definition at line 80 of file mem_manager.cc.

References initialize_pool, and large_pool.

Referenced by remember_memory().

void flush_memory void   ) 
 

Definition at line 94 of file mem_manager.cc.

References initialize_pool, large_pool, LargeStk::pop(), and LargeStk::size().

void remember_memory void *  ptr,
unsigned int  size
 

friend void* recall_memory( size_t size );

Definition at line 114 of file mem_manager.cc.

References initialize_memory_pool(), initialize_pool, large_pool, and LargeStk::push().

Referenced by Listable::operator delete().

void* recall_memory unsigned int  size  ) 
 

void * recall_memory( size_t size );

Definition at line 137 of file mem_manager.cc.

References initialize_pool, large_pool, and LargeStk::pop().

void* pmalloc int  size  ) 
 

... Add 8 because two words are used by malloc

Definition at line 158 of file mem_manager.cc.

References _allocated_bytes, _top_address, and _total_alloc.

Referenced by check_new(), Zombie::operator new(), and strip_outer_quotes().

void pfree void *  ptr  ) 
 

... Subtract stored length + 3 bytes which is used to store the length

Definition at line 171 of file mem_manager.cc.

References _allocated_bytes.

Referenced by Program::read().


Variable Documentation

int initialize_pool = 1 [static]
 

Definition at line 24 of file mem_manager.cc.

Referenced by flush_memory(), initialize_memory_pool(), recall_memory(), and remember_memory().

LargeStk* large_pool = 0 [static]
 

Definition at line 76 of file mem_manager.cc.

Referenced by flush_memory(), initialize_memory_pool(), recall_memory(), and remember_memory().

int _allocated_bytes = 0
 

Definition at line 153 of file mem_manager.cc.

Referenced by pfree(), and pmalloc().

int _total_alloc = 0
 

Definition at line 154 of file mem_manager.cc.

Referenced by pmalloc().

void* _top_address = 0
 

Definition at line 155 of file mem_manager.cc.

Referenced by pmalloc().

 © 1995-2005 University of Illinois, Urbana-Champaign. All rights reserved.  Fri Mar 25 23:06:23 2005