List:Commits« Previous MessageNext Message »
From:U-ROWVWADEjas Date:August 27 2007 9:23pm
Subject:bk commit into 6.0-falcon tree (jas:1.2718)
View as plain text  
Below is the list of changes that have just been committed into a local
6.0-falcon repository of . When  does a push these changes will
be propagated to the main repository and, within 24 hours after the
push, to the public repository.
For information on how to access the public repository
see http://dev.mysql.com/doc/mysql/en/installing-source-tree.html

ChangeSet@stripped, 2007-08-27 17:23:33-04:00, jas@rowvwade. +1 -0
  Experiment with valgind support for the memory manager.

  storage/falcon/MemMgr.cpp@stripped, 2007-08-27 17:23:25-04:00, jas@rowvwade. +21 -7
    Experiment with valgind support for the memory manager.

# This is a BitKeeper patch.  What follows are the unified diffs for the
# set of deltas contained in the patch.  The rest of the patch, the part
# that BitKeeper cares about, is below these diffs.
# User:	jas
# Host:	rowvwade.
# Root:	D:/MySQL/mysql-5.1-falcon

--- 1.38/storage/falcon/MemMgr.cpp	2007-08-27 17:23:49 -04:00
+++ 1.39/storage/falcon/MemMgr.cpp	2007-08-27 17:23:49 -04:00
@@ -33,9 +33,17 @@
 #include "Interlock.h"
 #include "Stream.h"
 #include "InfoTable.h"
-//#include "RecordVersion.h"
 #include "MemControl.h"
 
+#ifdef HAVE_purify
+#include <valgrind/memcheck.h>
+#endif
+
+#ifndef VALGRIND_MAKE_MEM_UNDEFINED
+#define VALGRIND_MAKE_MEM_DEFINED(address, length)
+#define VALGRIND_MAKE_MEM_UNDEFINED(address, length)
+#endif
+
 #ifdef ENGINE
 #include "Log.h"
 #include "LogStream.h"
@@ -105,26 +113,26 @@
 #ifdef _DEBUG
 	void* MemMgrPoolAllocateDebug (MemMgr *pool, unsigned int s, const char *file, int line)
 		{
-		void *object = pool->allocateDebug (s, file, line);
+		void *object = pool->allocateDebug(s, file, line);
 
 		if (object == stopAddress)
-			printf ("MemMgrAllocateDebug at %p\n", stopAddress);
+			printf("MemMgrAllocateDebug at %p\n", stopAddress);
 
 		if (traceFile)
-			fprintf (traceFile, "a %d %p\n", s, object);
+			fprintf(traceFile, "a %d %p\n", s, object);
 
 		return object;
 		}
 
 	void* MemMgrAllocateDebug (unsigned int s, const char *file, int line)
 		{
-		void *object = memoryManager.allocateDebug (s, file, line);
+		void *object = memoryManager.allocateDebug(s, file, line);
 
 		if (object == stopAddress)
-			printf ("MemMgrAllocateDebug at %p\n", stopAddress);
+			printf("MemMgrAllocateDebug at %p\n", stopAddress);
 
 		if (traceFile)
-			fprintf (traceFile, "a %d %p\n", s, object);
+			fprintf(traceFile, "a %d %p\n", s, object);
 
 		return object;
 		}
@@ -516,6 +524,7 @@
 
 	++blocksAllocated;
 	++blocksActive;
+	VALGRIND_MAKE_MEM_UNDEFINED(&memory->body, size);
 	
 	return &memory->body;
 }
@@ -549,6 +558,7 @@
 	++blocksAllocated;
 	++blocksActive;
 	//validateBlock(&memory->body);
+	VALGRIND_MAKE_MEM_UNDEFINED(&memory->body, size);
 
 	return &memory->body;
 }
@@ -563,6 +573,7 @@
 		if (block->pool == NULL)
 			{
 			free(block);	// releaseRaw(block);
+			
 			return;
 			}
 			
@@ -591,6 +602,7 @@
 	
 	if (length < 0)
 		{
+		VALGRIND_MAKE_MEM_DEFINED(block, -length);
 #ifdef MEM_DEBUG
 		block->lineNumber = -block->lineNumber;
 		memset (&block->body, DELETE_BYTE, -length - OFFSET(MemBlock*, body));
@@ -607,6 +619,8 @@
 		}
 	
 	// OK, this is a large block.  Try recombining with neighbors
+
+	VALGRIND_MAKE_MEM_DEFINED(block, length);
 
 #ifdef MEM_DEBUG
 	memset (&block->body, DELETE_BYTE, length - OFFSET(MemBlock*, body));
Thread
bk commit into 6.0-falcon tree (jas:1.2718)U-ROWVWADEjas27 Aug