diff options
author | Mattias Andrée <maandree@operamail.com> | 2015-08-30 15:38:29 +0200 |
---|---|---|
committer | Mattias Andrée <maandree@operamail.com> | 2015-08-30 15:38:29 +0200 |
commit | 8e919f92320c8fbe79436d786101cd63446568d1 (patch) | |
tree | 6e82fe676aa3bf7a67eb4f94d100696857fc71e3 /include | |
parent | add missing inclusions of stddef.h to define NULL (diff) | |
download | slibc-8e919f92320c8fbe79436d786101cd63446568d1.tar.gz slibc-8e919f92320c8fbe79436d786101cd63446568d1.tar.bz2 slibc-8e919f92320c8fbe79436d786101cd63446568d1.tar.xz |
add crealloc
Signed-off-by: Mattias Andrée <maandree@operamail.com>
Diffstat (limited to '')
-rw-r--r-- | include/slibc-alloc.h | 12 |
1 files changed, 12 insertions, 0 deletions
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`, |