From 8e919f92320c8fbe79436d786101cd63446568d1 Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Sun, 30 Aug 2015 15:38:29 +0200 Subject: add crealloc MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- include/slibc-alloc.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'include') diff --git a/include/slibc-alloc.h b/include/slibc-alloc.h index 4453fc6..0308482 100644 --- a/include/slibc-alloc.h +++ b/include/slibc-alloc.h @@ -58,6 +58,18 @@ void secure_free(void*); */ size_t allocsize(void*); /* TODO not implemented */ +/** + * Variant of `realloc` that overrides newly allocated space + * with zeroes. Additionally, it will override any freed space + * with zeroes, including the old allocation if it creates a + * new allocation. + * + * @param ptr The old allocation, see `realloc` for more details. + * @param size The new allocation size, see `realloc` for more details. + * @return The new allocation, see `realloc` for more details. + */ +void* crealloc(void*, size_t); /* TODO not implemented */ + /** * This macro calls `fast_free` and then sets the pointer to `NULL`, -- cgit v1.2.3-70-g09d2