OLD | NEW |
1 /* Alloc.c -- Memory allocation functions | 1 /* Alloc.c -- Memory allocation functions |
2 2008-09-24 | 2 2015-02-21 : Igor Pavlov : Public domain */ |
3 Igor Pavlov | 3 |
4 Public domain */ | 4 #include "Precomp.h" |
5 | 5 |
6 #ifdef _WIN32 | 6 #ifdef _WIN32 |
7 #include <windows.h> | 7 #include <windows.h> |
8 #endif | 8 #endif |
9 #include <stdlib.h> | 9 #include <stdlib.h> |
10 | 10 |
11 #include "Alloc.h" | 11 #include "Alloc.h" |
12 | 12 |
13 /* #define _SZ_ALLOC_DEBUG */ | 13 /* #define _SZ_ALLOC_DEBUG */ |
14 | 14 |
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
118 if (address != 0) | 118 if (address != 0) |
119 fprintf(stderr, "\nFree_Big; count = %10d", --g_allocCountBig); | 119 fprintf(stderr, "\nFree_Big; count = %10d", --g_allocCountBig); |
120 #endif | 120 #endif |
121 | 121 |
122 if (address == 0) | 122 if (address == 0) |
123 return; | 123 return; |
124 VirtualFree(address, 0, MEM_RELEASE); | 124 VirtualFree(address, 0, MEM_RELEASE); |
125 } | 125 } |
126 | 126 |
127 #endif | 127 #endif |
| 128 |
| 129 |
| 130 static void *SzAlloc(void *p, size_t size) { UNUSED_VAR(p); return MyAlloc(size)
; } |
| 131 static void SzFree(void *p, void *address) { UNUSED_VAR(p); MyFree(address); } |
| 132 ISzAlloc g_Alloc = { SzAlloc, SzFree }; |
| 133 |
| 134 static void *SzBigAlloc(void *p, size_t size) { UNUSED_VAR(p); return BigAlloc(s
ize); } |
| 135 static void SzBigFree(void *p, void *address) { UNUSED_VAR(p); BigFree(address);
} |
| 136 ISzAlloc g_BigAlloc = { SzBigAlloc, SzBigFree }; |
OLD | NEW |