aboutsummaryrefslogtreecommitdiff
path: root/C/Alloc.h
diff options
context:
space:
mode:
authorIgor Pavlov <87184205+ip7z@users.noreply.github.com>2023-06-21 00:00:00 +0000
committerIgor Pavlov <87184205+ip7z@users.noreply.github.com>2023-12-17 14:59:19 +0500
commit5b39dc76f1bc82f941d5c800ab9f34407a06b53a (patch)
treefe5e17420300b715021a76328444088d32047963 /C/Alloc.h
parent93be7d4abfd4233228f58ee1fbbcd76d91be66a4 (diff)
download7zip-5b39dc76f1bc82f941d5c800ab9f34407a06b53a.tar.gz
7zip-5b39dc76f1bc82f941d5c800ab9f34407a06b53a.tar.bz2
7zip-5b39dc76f1bc82f941d5c800ab9f34407a06b53a.zip
23.0123.01
Diffstat (limited to 'C/Alloc.h')
-rw-r--r--C/Alloc.h19
1 files changed, 16 insertions, 3 deletions
diff --git a/C/Alloc.h b/C/Alloc.h
index 3be2041..fac5b62 100644
--- a/C/Alloc.h
+++ b/C/Alloc.h
@@ -1,19 +1,32 @@
1/* Alloc.h -- Memory allocation functions 1/* Alloc.h -- Memory allocation functions
22021-07-13 : Igor Pavlov : Public domain */ 22023-03-04 : Igor Pavlov : Public domain */
3 3
4#ifndef __COMMON_ALLOC_H 4#ifndef ZIP7_INC_ALLOC_H
5#define __COMMON_ALLOC_H 5#define ZIP7_INC_ALLOC_H
6 6
7#include "7zTypes.h" 7#include "7zTypes.h"
8 8
9EXTERN_C_BEGIN 9EXTERN_C_BEGIN
10 10
11/*
12 MyFree(NULL) : is allowed, as free(NULL)
13 MyAlloc(0) : returns NULL : but malloc(0) is allowed to return NULL or non_NULL
14 MyRealloc(NULL, 0) : returns NULL : but realloc(NULL, 0) is allowed to return NULL or non_NULL
15MyRealloc() is similar to realloc() for the following cases:
16 MyRealloc(non_NULL, 0) : returns NULL and always calls MyFree(ptr)
17 MyRealloc(NULL, non_ZERO) : returns NULL, if allocation failed
18 MyRealloc(non_NULL, non_ZERO) : returns NULL, if reallocation failed
19*/
20
11void *MyAlloc(size_t size); 21void *MyAlloc(size_t size);
12void MyFree(void *address); 22void MyFree(void *address);
23void *MyRealloc(void *address, size_t size);
13 24
14#ifdef _WIN32 25#ifdef _WIN32
15 26
27#ifdef Z7_LARGE_PAGES
16void SetLargePageSize(void); 28void SetLargePageSize(void);
29#endif
17 30
18void *MidAlloc(size_t size); 31void *MidAlloc(size_t size);
19void MidFree(void *address); 32void MidFree(void *address);