[llvm-commits] [poolalloc] r66275 - /poolalloc/trunk/lib/DSA/DataStructure.cpp
John Criswell
criswell at uiuc.edu
Fri Mar 6 09:33:31 PST 2009
Author: criswell
Date: Fri Mar 6 11:33:31 2009
New Revision: 66275
URL: http://llvm.org/viewvc/llvm-project?rev=66275&view=rev
Log:
Initialize the pointer fields used in the linked list implementation to NULL
when a DSNode is created.
This makes debugging list traversal problems easier.
Modified:
poolalloc/trunk/lib/DSA/DataStructure.cpp
Modified: poolalloc/trunk/lib/DSA/DataStructure.cpp
URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/lib/DSA/DataStructure.cpp?rev=66275&r1=66274&r2=66275&view=diff
==============================================================================
--- poolalloc/trunk/lib/DSA/DataStructure.cpp (original)
+++ poolalloc/trunk/lib/DSA/DataStructure.cpp Fri Mar 6 11:33:31 2009
@@ -147,6 +147,9 @@
if (T) mergeTypeInfo(T, 0);
if (G) G->addNode(this);
++NumNodeAllocated;
+
+ // Be good memory stewards and give our pointers a default of NULL
+ Next = Prev = 0;
}
// DSNode copy constructor... do not copy over the referrers list!
@@ -159,6 +162,9 @@
Links.resize(N.Links.size()); // Create the appropriate number of null links
G->addNode(this);
++NumNodeAllocated;
+
+ // Be good memory stewards and give our pointers a default of NULL
+ Next = Prev = 0;
}
DSNode::~DSNode() {
More information about the llvm-commits
mailing list