From f54166e7ef5313c3b5c773cbb0ca2af95f5a15ae Mon Sep 17 00:00:00 2001 From: Jason Evans Date: Mon, 23 Apr 2012 22:41:36 -0700 Subject: [PATCH] Add missing Valgrind annotations. --- src/arena.c | 3 +++ src/chunk.c | 1 + 2 files changed, 4 insertions(+) diff --git a/src/arena.c b/src/arena.c index 6f28abe9..f13b5e1e 100644 --- a/src/arena.c +++ b/src/arena.c @@ -1131,6 +1131,8 @@ arena_bin_nonfull_run_get(arena_t *arena, arena_bin_t *bin) (uintptr_t)bin_info->bitmap_offset); /* Initialize run internals. */ + VALGRIND_MAKE_MEM_UNDEFINED(run, bin_info->reg0_offset - + bin_info->redzone_size); run->bin = bin; run->nextind = 0; run->nfree = bin_info->nregs; @@ -1924,6 +1926,7 @@ arena_ralloc(void *ptr, size_t oldsize, size_t size, size_t extra, * expectation that the extra bytes will be reliably preserved. */ copysize = (size < oldsize) ? size : oldsize; + VALGRIND_MAKE_MEM_UNDEFINED(ret, copysize); memcpy(ret, ptr, copysize); iqalloc(ptr); return (ret); diff --git a/src/chunk.c b/src/chunk.c index 5426b027..7ac229cb 100644 --- a/src/chunk.c +++ b/src/chunk.c @@ -168,6 +168,7 @@ label_return: size_t i; size_t *p = (size_t *)(uintptr_t)ret; + VALGRIND_MAKE_MEM_DEFINED(ret, size); for (i = 0; i < size / sizeof(size_t); i++) assert(p[i] == 0); }