From e52e49b32f5cf862a414da63e5dbd2eb04ad758e Mon Sep 17 00:00:00 2001 From: Elliott Hughes Date: Mon, 2 Apr 2012 16:05:44 -0700 Subject: Fix the mutex diagnostics, and other targets of opportunity. Three changes for the price of one: 1. Fix the mutex diagnostics so they work right during startup and shutdown. 2. Fix a memory leak in common_test. 3. Fix memory corruption in the compiler; we were calling memset(3) on a struct with non-POD members. Thanks, as usual, to valgrind(1) for the latter two (and several bugs in earlier attempts at the former). Change-Id: I15e1ffb01e73e4c56a5bbdcaa7233a4b5221e08a --- src/compiler/CompilerUtility.h | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'src/compiler/CompilerUtility.h') diff --git a/src/compiler/CompilerUtility.h b/src/compiler/CompilerUtility.h index 41f6cf16bd..f7b9b0e7fd 100644 --- a/src/compiler/CompilerUtility.h +++ b/src/compiler/CompilerUtility.h @@ -43,11 +43,14 @@ void* oatNew(CompilationUnit* cUnit, size_t size, bool zero, void oatArenaReset(CompilationUnit *cUnit); struct GrowableList { - size_t numAllocated; - size_t numUsed; - intptr_t *elemList; + GrowableList() : numAllocated(0), numUsed(0), elemList(NULL) { + } + + size_t numAllocated; + size_t numUsed; + intptr_t* elemList; #ifdef WITH_MEMSTATS - oatListKind kind; + oatListKind kind; #endif }; -- cgit v1.2.3-59-g8ed1b