diff options
Diffstat (limited to 'C/Alloc.h')
-rw-r--r-- | C/Alloc.h | 15 |
1 files changed, 10 insertions, 5 deletions
@@ -1,5 +1,5 @@ | |||
1 | /* Alloc.h -- Memory allocation functions | 1 | /* Alloc.h -- Memory allocation functions |
2 | 2023-03-04 : Igor Pavlov : Public domain */ | 2 | 2024-01-22 : Igor Pavlov : Public domain */ |
3 | 3 | ||
4 | #ifndef ZIP7_INC_ALLOC_H | 4 | #ifndef ZIP7_INC_ALLOC_H |
5 | #define ZIP7_INC_ALLOC_H | 5 | #define ZIP7_INC_ALLOC_H |
@@ -22,6 +22,9 @@ void *MyAlloc(size_t size); | |||
22 | void MyFree(void *address); | 22 | void MyFree(void *address); |
23 | void *MyRealloc(void *address, size_t size); | 23 | void *MyRealloc(void *address, size_t size); |
24 | 24 | ||
25 | void *z7_AlignedAlloc(size_t size); | ||
26 | void z7_AlignedFree(void *p); | ||
27 | |||
25 | #ifdef _WIN32 | 28 | #ifdef _WIN32 |
26 | 29 | ||
27 | #ifdef Z7_LARGE_PAGES | 30 | #ifdef Z7_LARGE_PAGES |
@@ -33,12 +36,14 @@ void MidFree(void *address); | |||
33 | void *BigAlloc(size_t size); | 36 | void *BigAlloc(size_t size); |
34 | void BigFree(void *address); | 37 | void BigFree(void *address); |
35 | 38 | ||
39 | /* #define Z7_BIG_ALLOC_IS_ZERO_FILLED */ | ||
40 | |||
36 | #else | 41 | #else |
37 | 42 | ||
38 | #define MidAlloc(size) MyAlloc(size) | 43 | #define MidAlloc(size) z7_AlignedAlloc(size) |
39 | #define MidFree(address) MyFree(address) | 44 | #define MidFree(address) z7_AlignedFree(address) |
40 | #define BigAlloc(size) MyAlloc(size) | 45 | #define BigAlloc(size) z7_AlignedAlloc(size) |
41 | #define BigFree(address) MyFree(address) | 46 | #define BigFree(address) z7_AlignedFree(address) |
42 | 47 | ||
43 | #endif | 48 | #endif |
44 | 49 | ||