Commit | Line | Data |
---|---|---|
059ec3d9 PH |
1 | /************************************************* |
2 | * Exim - an Internet mail transport agent * | |
3 | *************************************************/ | |
4 | ||
0a49a7a4 | 5 | /* Copyright (c) University of Cambridge 1995 - 2009 */ |
059ec3d9 PH |
6 | /* See the file NOTICE for conditions of use and distribution. */ |
7 | ||
8 | /* Header for Exim's memory allocation functions */ | |
9 | ||
10 | #ifndef STORE_H | |
11 | #define STORE_H | |
12 | ||
13 | /* Define symbols for identifying the store pools. */ | |
14 | ||
15 | enum { POOL_MAIN, POOL_PERM, POOL_SEARCH }; | |
16 | ||
17 | /* This variable (the one for the current pool) is set by store_get() to its | |
18 | yield, and by store_reset() to NULL. This allows string_cat() to optimize its | |
19 | store handling. */ | |
20 | ||
21 | extern void *store_last_get[3]; | |
22 | ||
23 | /* This variable contains the current store pool number. */ | |
24 | ||
25 | extern int store_pool; | |
26 | ||
27 | /* Macros for calling the memory allocation routines with | |
28 | tracing information for debugging. */ | |
29 | ||
30 | #define store_extend(addr,old,new) \ | |
31 | store_extend_3(addr, old, new, __FILE__, __LINE__) | |
32 | ||
33 | #define store_free(addr) store_free_3(addr, __FILE__, __LINE__) | |
34 | #define store_get(size) store_get_3(size, __FILE__, __LINE__) | |
35 | #define store_get_perm(size) store_get_perm_3(size, __FILE__, __LINE__) | |
36 | #define store_malloc(size) store_malloc_3(size, __FILE__, __LINE__) | |
459fca58 JH |
37 | #define store_newblock(addr,newsize,datalen) \ |
38 | store_newblock_3(addr, newsize, datalen, __FILE__, __LINE__) | |
059ec3d9 PH |
39 | #define store_reset(addr) store_reset_3(addr, __FILE__, __LINE__) |
40 | ||
41 | ||
42 | /* The real functions */ | |
43 | ||
459fca58 JH |
44 | /* The value of the 2nd arg is __FILE__ in every call, so give its correct type */ |
45 | extern BOOL store_extend_3(void *, int, int, const char *, int); | |
46 | extern void store_free_3(void *, const char *, int); | |
47 | extern void *store_get_3(int, const char *, int); | |
48 | extern void *store_get_perm_3(int, const char *, int); | |
49 | extern void *store_malloc_3(int, const char *, int); | |
50 | extern void *store_newblock_3(void *, int, int, const char *, int); | |
51 | extern void store_reset_3(void *, const char *, int); | |
059ec3d9 PH |
52 | |
53 | #endif /* STORE_H */ | |
54 | ||
55 | /* End of store.h */ |