doom3-gpl
Doom 3 GPL source release
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Classes | Public Member Functions | Private Types | Private Member Functions | Private Attributes | List of all members
idHeap Class Reference

Classes

struct  mediumHeapEntry_s
 
struct  page_s
 

Public Member Functions

 idHeap (void)
 
 ~idHeap (void)
 
void Init (void)
 
voidAllocate (const dword bytes)
 
void Free (void *p)
 
voidAllocate16 (const dword bytes)
 
void Free16 (void *p)
 
dword Msize (void *p)
 
void Dump (void)
 
void AllocDefragBlock (void)
 

Private Types

enum  { ALIGN = 8 }
 
enum  { INVALID_ALLOC = 0xdd, SMALL_ALLOC = 0xaa, MEDIUM_ALLOC = 0xbb, LARGE_ALLOC = 0xcc }
 

Private Member Functions

page_sAllocatePage (dword bytes)
 
void FreePage (idHeap::page_s *p)
 
voidSmallAllocate (dword bytes)
 
void SmallFree (void *ptr)
 
voidMediumAllocateFromPage (idHeap::page_s *p, dword sizeNeeded)
 
voidMediumAllocate (dword bytes)
 
void MediumFree (void *ptr)
 
voidLargeAllocate (dword bytes)
 
void LargeFree (void *ptr)
 
void ReleaseSwappedPages (void)
 
void FreePageReal (idHeap::page_s *p)
 

Private Attributes

voidsmallFirstFree [256/ALIGN+1]
 
page_ssmallCurPage
 
dword smallCurPageOffset
 
page_ssmallFirstUsedPage
 
page_smediumFirstFreePage
 
page_smediumLastFreePage
 
page_smediumFirstUsedPage
 
page_slargeFirstUsedPage
 
page_sswapPage
 
dword pagesAllocated
 
dword pageSize
 
dword pageRequests
 
dword OSAllocs
 
int c_heapAllocRunningCount
 
voiddefragBlock
 

Detailed Description

Definition at line 55 of file Heap.cpp.

Member Enumeration Documentation

anonymous enum
private
Enumerator
ALIGN 

Definition at line 72 of file Heap.cpp.

anonymous enum
private
Enumerator
INVALID_ALLOC 
SMALL_ALLOC 
MEDIUM_ALLOC 
LARGE_ALLOC 

Definition at line 76 of file Heap.cpp.

Constructor & Destructor Documentation

idHeap::idHeap ( void  )

Definition at line 180 of file Heap.cpp.

idHeap::~idHeap ( void  )

Definition at line 191 of file Heap.cpp.

Member Function Documentation

void * idHeap::Allocate ( const dword  bytes)

Definition at line 261 of file Heap.cpp.

void * idHeap::Allocate16 ( const dword  bytes)

Definition at line 320 of file Heap.cpp.

idHeap::page_s * idHeap::AllocatePage ( dword  bytes)
private

Definition at line 464 of file Heap.cpp.

void idHeap::AllocDefragBlock ( void  )

Definition at line 240 of file Heap.cpp.

void idHeap::Dump ( void  )

Definition at line 401 of file Heap.cpp.

void idHeap::Free ( void p)

Definition at line 285 of file Heap.cpp.

void idHeap::Free16 ( void p)

Definition at line 349 of file Heap.cpp.

void idHeap::FreePage ( idHeap::page_s p)
private

Definition at line 515 of file Heap.cpp.

void idHeap::FreePageReal ( idHeap::page_s p)
private

Definition at line 436 of file Heap.cpp.

void idHeap::Init ( void  )

Definition at line 151 of file Heap.cpp.

void * idHeap::LargeAllocate ( dword  bytes)
private

Definition at line 922 of file Heap.cpp.

void idHeap::LargeFree ( void ptr)
private

Definition at line 955 of file Heap.cpp.

void * idHeap::MediumAllocate ( dword  bytes)
private

Definition at line 688 of file Heap.cpp.

void * idHeap::MediumAllocateFromPage ( idHeap::page_s p,
dword  sizeNeeded 
)
private

Definition at line 625 of file Heap.cpp.

void idHeap::MediumFree ( void ptr)
private

Definition at line 792 of file Heap.cpp.

dword idHeap::Msize ( void p)

Definition at line 363 of file Heap.cpp.

void idHeap::ReleaseSwappedPages ( void  )
private

Definition at line 448 of file Heap.cpp.

void * idHeap::SmallAllocate ( dword  bytes)
private

Definition at line 543 of file Heap.cpp.

void idHeap::SmallFree ( void ptr)
private

Definition at line 589 of file Heap.cpp.

Member Data Documentation

int idHeap::c_heapAllocRunningCount
private

Definition at line 122 of file Heap.cpp.

void* idHeap::defragBlock
private

Definition at line 124 of file Heap.cpp.

page_s* idHeap::largeFirstUsedPage
private

Definition at line 112 of file Heap.cpp.

page_s* idHeap::mediumFirstFreePage
private

Definition at line 108 of file Heap.cpp.

page_s* idHeap::mediumFirstUsedPage
private

Definition at line 110 of file Heap.cpp.

page_s* idHeap::mediumLastFreePage
private

Definition at line 109 of file Heap.cpp.

dword idHeap::OSAllocs
private

Definition at line 120 of file Heap.cpp.

dword idHeap::pageRequests
private

Definition at line 119 of file Heap.cpp.

dword idHeap::pagesAllocated
private

Definition at line 116 of file Heap.cpp.

dword idHeap::pageSize
private

Definition at line 117 of file Heap.cpp.

page_s* idHeap::smallCurPage
private

Definition at line 104 of file Heap.cpp.

dword idHeap::smallCurPageOffset
private

Definition at line 105 of file Heap.cpp.

void* idHeap::smallFirstFree[256/ALIGN+1]
private

Definition at line 103 of file Heap.cpp.

page_s* idHeap::smallFirstUsedPage
private

Definition at line 106 of file Heap.cpp.

page_s* idHeap::swapPage
private

Definition at line 114 of file Heap.cpp.


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