#include "qbsp.h"
#include "l_log.h"
Include dependency graph for l_mem.c:

Go to the source code of this file.
Data Structures | |
| struct | memhunk_s |
Typedefs | |
| typedef memhunk_s | memhunk_t |
Functions | |
| void | FreeMemory (void *ptr) |
| void * | GetClearedMemory (int size) |
| void * | GetMemory (unsigned long size) |
| void * | Hunk_Alloc (int size) |
| void | Hunk_ClearHigh (void) |
| int | MemorySize (void *ptr) |
| void | PrintMemorySize (unsigned long size) |
| int | TotalAllocatedMemory (void) |
| void | Z_Free (void *ptr) |
| void * | Z_Malloc (int size) |
Variables | |
| int | allocedmemory |
| memhunk_t * | memhunk_high |
| int | memhunk_high_size = 16 * 1024 * 1024 |
| memhunk_t * | memhunk_low |
| int | memhunk_low_size = 0 |
|
|
Referenced by Hunk_Alloc(), and Hunk_ClearHigh(). |
|
Here is the call graph for this function:

|
Here is the call graph for this function:

|
Here is the call graph for this function:

|
|
Definition at line 409 of file l_mem.c. References GetClearedMemory(), h(), memhunk_high, memhunk_high_size, memhunk_t, memhunk_s::next, and memhunk_s::ptr. 00410 {
00411 memhunk_t *h;
00412
00413 if (!size) return (void *) memhunk_high_size;
00414 //
00415 h = GetClearedMemory(size + sizeof(memhunk_t));
00416 h->ptr = (char *) h + sizeof(memhunk_t);
00417 h->next = memhunk_high;
00418 memhunk_high = h;
00419 memhunk_high_size -= size;
00420 return h->ptr;
00421 } //end of the function Hunk_Alloc
|
Here is the call graph for this function:

|
|
Definition at line 391 of file l_mem.c. References FreeMemory(), h(), memhunk_high, memhunk_high_size, memhunk_t, and memhunk_s::next. 00392 {
00393 memhunk_t *h, *nexth;
00394
00395 for (h = memhunk_high; h; h = nexth)
00396 {
00397 nexth = h->next;
00398 FreeMemory(h);
00399 } //end for
00400 memhunk_high = NULL;
00401 memhunk_high_size = 16 * 1024 * 1024;
00402 } //end of the function Hunk_ClearHigh
|
Here is the call graph for this function:

|
|
Definition at line 54 of file l_mem.c. References ptr(). Referenced by AllocBrush(), AllocNode(), AllocPortal(), AllocWinding(), FreeBrush(), FreeMemory(), FreePortal(), FreeWinding(), GetClearedMemory(), GetMemory(), Tree_Free(), Tree_Free_r(), and Tree_FreePortals_r(). 00055 {
00056 #if defined(WIN32) || defined(_WIN32)
00057 #ifdef __WATCOMC__
00058 //Intel 32 bits memory addressing, 16 bytes aligned
00059 return (_msize(ptr) + 15) >> 4 << 4;
00060 #else
00061 return _msize(ptr);
00062 #endif
00063 #else
00064 return 0;
00065 #endif
00066 } //end of the function MemorySize
|
Here is the call graph for this function:

|
|
Definition at line 34 of file l_mem.c. References Log_Print(). Referenced by AAS_AllocMaxAAS(), AAS_FreeMaxAAS(), HL_AllocMaxBSP(), HL_FreeMaxBSP(), Q1_AllocMaxBSP(), Q1_FreeMaxBSP(), Q2_AllocMaxBSP(), Q2_FreeMaxBSP(), Sin_AllocMaxBSP(), Sin_FreeMaxBSP(), and Tree_Free(). 00035 {
00036 unsigned long number1, number2, number3;
00037 number1 = size >> 20;
00038 number2 = (size & 0xFFFFF) >> 10;
00039 number3 = (size & 0x3FF);
00040 if (number1) Log_Print("%ld MB", number1);
00041 if (number1 && number2) Log_Print(" and ");
00042 if (number2) Log_Print("%ld KB", number2);
00043 if (number2 && number3) Log_Print(" and ");
00044 if (number3) Log_Print("%ld bytes", number3);
00045 } //end of the function PrintFileSize
|
Here is the call graph for this function:

|
|
Definition at line 114 of file l_mem.c. 00115 {
00116 return allocedmemory;
00117 } //end of the function TotalAllocatedMemory
|
|
|
Definition at line 438 of file l_mem.c. 00439 {
00440 FreeMemory(ptr);
00441 } //end of the function Z_Free
|
|
|
Definition at line 428 of file l_mem.c. 00429 {
00430 return GetClearedMemory(size);
00431 } //end of the function Z_Malloc
|
|
|
Definition at line 26 of file l_mem.c. Referenced by FreeMemory(), GetClearedMemory(), and GetMemory(). |
|
|
Definition at line 380 of file l_mem.c. Referenced by Hunk_Alloc(), and Hunk_ClearHigh(). |
|
|
Definition at line 382 of file l_mem.c. Referenced by Hunk_Alloc(), and Hunk_ClearHigh(). |
|
|
|
|
|
|
1.3.9.1