summaryrefslogtreecommitdiff
path: root/src/stdmem.h
diff options
context:
space:
mode:
authorWerner Koch <wk@gnupg.org>2016-12-07 10:37:50 +0100
committerWerner Koch <wk@gnupg.org>2016-12-07 10:37:50 +0100
commitb7df907dca4d525f8930c533b763ffce44ceed87 (patch)
tree0b2306a0487add7c4785112919b490b414482c1b /src/stdmem.h
parente366c19b34922c770af82cd035fd815680b29dee (diff)
downloadlibgcrypt-b7df907dca4d525f8930c533b763ffce44ceed87.tar.gz
Give the secmem allocators a hint when a xmalloc calls them.
* src/secmem.c (_gcry_secmem_malloc): New not yet used arg XHINT. (_gcry_secmem_realloc): Ditto. * src/stdmem.c (_gcry_private_malloc_secure): New arg XHINT to be passed to the secmem functions. (_gcry_private_realloc): Ditto. * src/g10lib.h (GCRY_ALLOC_FLAG_XHINT): New. * src/global.c (do_malloc): Pass this flag as XHINT to the private allocator. (_gcry_malloc_secure): Factor code out to ... (_gcry_malloc_secure_core): this. Add arg XHINT. (_gcry_realloc): Factor code out to ... (_gcry_realloc_core): here. Add arg XHINT. (_gcry_strdup): Factor code out to ... (_gcry_strdup_core): here. Add arg XHINT. (_gcry_xrealloc): Use the core function and pass true for XHINT. (_gcry_xmalloc_secure): Ditto. (_gcry_xstrdup): Ditto. Signed-off-by: Werner Koch <wk@gnupg.org>
Diffstat (limited to 'src/stdmem.h')
-rw-r--r--src/stdmem.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/stdmem.h b/src/stdmem.h
index b476e7e5..c52aab54 100644
--- a/src/stdmem.h
+++ b/src/stdmem.h
@@ -24,8 +24,8 @@
void _gcry_private_enable_m_guard(void);
void *_gcry_private_malloc (size_t n) _GCRY_GCC_ATTR_MALLOC;
-void *_gcry_private_malloc_secure (size_t n) _GCRY_GCC_ATTR_MALLOC;
-void *_gcry_private_realloc (void *a, size_t n);
+void *_gcry_private_malloc_secure (size_t n, int xhint) _GCRY_GCC_ATTR_MALLOC;
+void *_gcry_private_realloc (void *a, size_t n, int xhint);
void _gcry_private_check_heap (const void *a);
void _gcry_private_free (void *a);