X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=src%2Fsrc%2Fstore.h;h=39b0f6ecfad58d4c4e6a047c0b1a8cc4952939f8;hb=7c6d46575a89c424346c6dbdc052b5e22cb0169f;hp=cb0a3cae9c4883b0948501fab8fe3e1a380ac4e7;hpb=459fca581ce9f1215a96885852b912558cdc9c63;p=exim.git diff --git a/src/src/store.h b/src/src/store.h index cb0a3cae9..39b0f6ecf 100644 --- a/src/src/store.h +++ b/src/src/store.h @@ -12,13 +12,15 @@ /* Define symbols for identifying the store pools. */ -enum { POOL_MAIN, POOL_PERM, POOL_SEARCH }; +enum { POOL_MAIN, POOL_PERM, POOL_SEARCH, + POOL_TAINT_BASE, + POOL_TAINT_MAIN = POOL_TAINT_BASE, POOL_TAINT_PERM, POOL_TAINT_SEARCH }; /* This variable (the one for the current pool) is set by store_get() to its yield, and by store_reset() to NULL. This allows string_cat() to optimize its store handling. */ -extern void *store_last_get[3]; +extern void *store_last_get[6]; /* This variable contains the current store pool number. */ @@ -27,28 +29,35 @@ extern int store_pool; /* Macros for calling the memory allocation routines with tracing information for debugging. */ -#define store_extend(addr,old,new) \ - store_extend_3(addr, old, new, __FILE__, __LINE__) +#define store_extend(addr, tainted, old, new) \ + store_extend_3(addr, tainted, old, new, __FUNCTION__, __LINE__) -#define store_free(addr) store_free_3(addr, __FILE__, __LINE__) -#define store_get(size) store_get_3(size, __FILE__, __LINE__) -#define store_get_perm(size) store_get_perm_3(size, __FILE__, __LINE__) -#define store_malloc(size) store_malloc_3(size, __FILE__, __LINE__) -#define store_newblock(addr,newsize,datalen) \ - store_newblock_3(addr, newsize, datalen, __FILE__, __LINE__) -#define store_reset(addr) store_reset_3(addr, __FILE__, __LINE__) +#define store_free(addr) \ + store_free_3(addr, __FUNCTION__, __LINE__) +/* store_get & store_get_perm are in local_scan.h */ +#define store_malloc(size) \ + store_malloc_3(size, __FUNCTION__, __LINE__) +#define store_mark(void) \ + store_mark_3(__FUNCTION__, __LINE__) +#define store_newblock(addr, tainted, newsize, datalen) \ + store_newblock_3(addr, tainted, newsize, datalen, __FUNCTION__, __LINE__) +#define store_release_above(addr) \ + store_release_above_3(addr, __FUNCTION__, __LINE__) +#define store_reset(mark) \ + store_reset_3(mark, store_pool, __FUNCTION__, __LINE__) /* The real functions */ +typedef void ** rmark; -/* The value of the 2nd arg is __FILE__ in every call, so give its correct type */ -extern BOOL store_extend_3(void *, int, int, const char *, int); +extern BOOL store_extend_3(void *, BOOL, int, int, const char *, int); extern void store_free_3(void *, const char *, int); -extern void *store_get_3(int, const char *, int); -extern void *store_get_perm_3(int, const char *, int); -extern void *store_malloc_3(int, const char *, int); -extern void *store_newblock_3(void *, int, int, const char *, int); -extern void store_reset_3(void *, const char *, int); +/* store_get_3 & store_get_perm_3 are in local_scan.h */ +extern void *store_malloc_3(int, const char *, int) ALLOC ALLOC_SIZE(1) WARN_UNUSED_RESULT; +extern rmark store_mark_3(const char *, int); +extern void *store_newblock_3(void *, BOOL, int, int, const char *, int); +extern void store_release_above_3(void *, const char *, int); +extern rmark store_reset_3(rmark, int, const char *, int); #endif /* STORE_H */