doom3-gpl
Doom 3 GPL source release
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Classes | Macros | Functions
Heap.cpp File Reference
#include "../idlib/precompiled.h"

Go to the source code of this file.

Classes

class  idHeap
 
struct  idHeap::page_s
 
struct  idHeap::mediumHeapEntry_s
 

Macros

#define USE_LIBC_MALLOC   0
 
#define SMALL_HEADER_SIZE   ( (int) ( sizeof( byte ) + sizeof( byte ) ) )
 
#define MEDIUM_HEADER_SIZE   ( (int) ( sizeof( mediumHeapEntry_s ) + sizeof( byte ) ) )
 
#define LARGE_HEADER_SIZE   ( (int) ( sizeof( dword * ) + sizeof( byte ) ) )
 
#define ALIGN_SIZE(bytes)   ( ( (bytes) + ALIGN - 1 ) & ~(ALIGN - 1) )
 
#define SMALL_ALIGN(bytes)   ( ALIGN_SIZE( (bytes) + SMALL_HEADER_SIZE ) - SMALL_HEADER_SIZE )
 
#define MEDIUM_SMALLEST_SIZE   ( ALIGN_SIZE( 256 ) + ALIGN_SIZE( MEDIUM_HEADER_SIZE ) )
 

Functions

void Mem_ClearFrameStats (void)
 
void Mem_GetFrameStats (memoryStats_t &allocs, memoryStats_t &frees)
 
void Mem_GetStats (memoryStats_t &stats)
 
void Mem_UpdateStats (memoryStats_t &stats, int size)
 
void Mem_UpdateAllocStats (int size)
 
void Mem_UpdateFreeStats (int size)
 
voidMem_Alloc (const int size)
 
void Mem_Free (void *ptr)
 
voidMem_Alloc16 (const int size)
 
void Mem_Free16 (void *ptr)
 
voidMem_ClearedAlloc (const int size)
 
void Mem_AllocDefragBlock (void)
 
char * Mem_CopyString (const char *in)
 
void Mem_Dump_f (const idCmdArgs &args)
 
void Mem_DumpCompressed_f (const idCmdArgs &args)
 
void Mem_Init (void)
 
void Mem_Shutdown (void)
 
void Mem_EnableLeakTest (const char *name)
 

Macro Definition Documentation

#define ALIGN_SIZE (   bytes)    ( ( (bytes) + ALIGN - 1 ) & ~(ALIGN - 1) )

Definition at line 50 of file Heap.cpp.

#define LARGE_HEADER_SIZE   ( (int) ( sizeof( dword * ) + sizeof( byte ) ) )

Definition at line 48 of file Heap.cpp.

#define MEDIUM_HEADER_SIZE   ( (int) ( sizeof( mediumHeapEntry_s ) + sizeof( byte ) ) )

Definition at line 47 of file Heap.cpp.

#define MEDIUM_SMALLEST_SIZE   ( ALIGN_SIZE( 256 ) + ALIGN_SIZE( MEDIUM_HEADER_SIZE ) )

Definition at line 52 of file Heap.cpp.

#define SMALL_ALIGN (   bytes)    ( ALIGN_SIZE( (bytes) + SMALL_HEADER_SIZE ) - SMALL_HEADER_SIZE )

Definition at line 51 of file Heap.cpp.

#define SMALL_HEADER_SIZE   ( (int) ( sizeof( byte ) + sizeof( byte ) ) )

Definition at line 46 of file Heap.cpp.

#define USE_LIBC_MALLOC   0

Definition at line 33 of file Heap.cpp.

Function Documentation

void* Mem_Alloc ( const int  size)

Definition at line 1067 of file Heap.cpp.

void* Mem_Alloc16 ( const int  size)

Definition at line 1107 of file Heap.cpp.

void Mem_AllocDefragBlock ( void  )

Definition at line 1160 of file Heap.cpp.

void* Mem_ClearedAlloc ( const int  size)

Definition at line 1149 of file Heap.cpp.

void Mem_ClearFrameStats ( void  )

Definition at line 996 of file Heap.cpp.

char* Mem_CopyString ( const char *  in)

Definition at line 1169 of file Heap.cpp.

void Mem_Dump_f ( const idCmdArgs args)

Definition at line 1182 of file Heap.cpp.

void Mem_DumpCompressed_f ( const idCmdArgs args)

Definition at line 1190 of file Heap.cpp.

void Mem_EnableLeakTest ( const char *  name)

Definition at line 1219 of file Heap.cpp.

void Mem_Free ( void ptr)

Definition at line 1087 of file Heap.cpp.

void Mem_Free16 ( void ptr)

Definition at line 1128 of file Heap.cpp.

void Mem_GetFrameStats ( memoryStats_t allocs,
memoryStats_t frees 
)

Definition at line 1008 of file Heap.cpp.

void Mem_GetStats ( memoryStats_t stats)

Definition at line 1018 of file Heap.cpp.

void Mem_Init ( void  )

Definition at line 1198 of file Heap.cpp.

void Mem_Shutdown ( void  )

Definition at line 1208 of file Heap.cpp.

void Mem_UpdateAllocStats ( int  size)

Definition at line 1043 of file Heap.cpp.

void Mem_UpdateFreeStats ( int  size)

Definition at line 1053 of file Heap.cpp.

void Mem_UpdateStats ( memoryStats_t stats,
int  size 
)

Definition at line 1027 of file Heap.cpp.