close[t:4671] Annotate every malloc with {{{ANNOTATE_NEW_MEMORY()}}} and get rid of the {{{--check-stack-var-yes}}}. This fixes for valgrind 3.7.0 but not for valgrind 3.6.1. Closes #4671.

git-svn-id: file:///svn/toku/tokudb@41430 c7de825b-a66e-492c-adef-691d508d4ae1
This commit is contained in:
Bradley C. Kuszmaul 2013-04-17 00:00:14 -04:00 committed by Yoni Fogel
parent 7cabbcf6bf
commit b9a7c166ab
2 changed files with 5 additions and 2 deletions

View file

@ -7,6 +7,7 @@
#include <stdlib.h>
#include <malloc.h>
#include <dlfcn.h>
#include <valgrind/helgrind.h>
#include "memory.h"
#include "toku_assert.h"
@ -108,6 +109,7 @@ void *
toku_malloc(size_t size) {
void *p = t_malloc ? t_malloc(size) : os_malloc(size);
if (p) {
ANNOTATE_NEW_MEMORY(p, size);
if (toku_memory_do_stats) {
size_t used = my_malloc_usable_size(p);
__sync_add_and_fetch(&status.malloc_count, 1);
@ -118,7 +120,7 @@ toku_malloc(size_t size) {
} else {
__sync_add_and_fetch(&status.malloc_fail, 1);
}
return p;
return p;
}
void *
@ -185,6 +187,7 @@ toku_xmalloc(size_t size) {
void *p = t_xmalloc ? t_xmalloc(size) : os_malloc(size);
if (p == NULL) // avoid function call in common case
resource_assert(p);
ANNOTATE_NEW_MEMORY(p, size);
if (toku_memory_do_stats) {
size_t used = my_malloc_usable_size(p);
__sync_add_and_fetch(&status.malloc_count, 1);

View file

@ -1057,7 +1057,7 @@ tiny_%.drdrun: %.tdb
$(MAYBEINVERTER) $(SUMMARIZE_CMD)
mid_%.drdrun: %.tdb
./$< --only_create --envdir dir.$@ --num_elements 10000 && \
$(VALGRIND) --tool=drd --quiet --check-stack-var=yes --suppressions=drd.suppressions --error-exitcode=1 ./$< $(VERBVERBOSE) --only_stress --num_seconds 100 --envdir dir.$@ --num_elements 10000 \
$(VALGRIND) --tool=drd --quiet --suppressions=drd.suppressions --error-exitcode=1 ./$< $(VERBVERBOSE) --only_stress --num_seconds 100 --envdir dir.$@ --num_elements 10000 \
$(MAYBEINVERTER) $(SUMMARIZE_CMD)
large_%.drdrun: %.tdb
./$< --only_create --envdir dir.$@ && \