[llvm-commits] CVS: llvm-poolalloc/runtime/FL2Allocator/FreeListAllocator.cpp PoolAllocator.h
Chris Lattner
lattner at cs.uiuc.edu
Fri Mar 4 13:24:11 PST 2005
Changes in directory llvm-poolalloc/runtime/FL2Allocator:
FreeListAllocator.cpp updated: 1.39 -> 1.40
PoolAllocator.h updated: 1.21 -> 1.22
---
Log message:
Print out _pc after calls so that we can tell which runtime library calls are which.
---
Diffs of the changes: (+14 -9)
FreeListAllocator.cpp | 20 +++++++++++---------
PoolAllocator.h | 3 +++
2 files changed, 14 insertions(+), 9 deletions(-)
Index: llvm-poolalloc/runtime/FL2Allocator/FreeListAllocator.cpp
diff -u llvm-poolalloc/runtime/FL2Allocator/FreeListAllocator.cpp:1.39 llvm-poolalloc/runtime/FL2Allocator/FreeListAllocator.cpp:1.40
--- llvm-poolalloc/runtime/FL2Allocator/FreeListAllocator.cpp:1.39 Fri Mar 4 10:03:14 2005
+++ llvm-poolalloc/runtime/FL2Allocator/FreeListAllocator.cpp Fri Mar 4 15:23:55 2005
@@ -454,8 +454,9 @@
Pool->DeclaredSize = DeclaredSize;
- DO_IF_TRACE(fprintf(stderr, "[%d] poolinit(0x%X, %d, %d)\n",
- addPoolNumber(Pool), Pool, DeclaredSize, ObjAlignment));
+ DO_IF_TRACE(fprintf(stderr, "[%d] poolinit%s(0x%X, %d, %d)\n",
+ addPoolNumber(Pool), PoolTraits::getSuffix(),
+ Pool, DeclaredSize, ObjAlignment));
DO_IF_PNP(++PoolsInited); // Track # pools initialized
DO_IF_PNP(InitPrintNumPools<PoolTraits>());
}
@@ -492,8 +493,8 @@
template<typename PoolTraits>
static void *poolalloc_internal(PoolTy<PoolTraits> *Pool, unsigned NumBytes) {
- DO_IF_TRACE(fprintf(stderr, "[%d] poolalloc(%d) -> ",
- getPoolNumber(Pool), NumBytes));
+ DO_IF_TRACE(fprintf(stderr, "[%d] poolalloc%s(%d) -> ",
+ getPoolNumber(Pool), PoolTraits::getSuffix(), NumBytes));
// If a null pool descriptor is passed in, this is not a pool allocated data
// structure. Hand off to the system malloc.
@@ -638,8 +639,8 @@
template<typename PoolTraits>
static void poolfree_internal(PoolTy<PoolTraits> *Pool, void *Node) {
if (Node == 0) return;
- DO_IF_TRACE(fprintf(stderr, "[%d] poolfree(0x%X) ",
- getPoolNumber(Pool), Node));
+ DO_IF_TRACE(fprintf(stderr, "[%d] poolfree%s(0x%X) ",
+ getPoolNumber(Pool), PoolTraits::getSuffix(), Node));
// If a null pool descriptor is passed in, this is not a pool allocated data
// structure. Hand off to the system free.
@@ -719,8 +720,9 @@
template<typename PoolTraits>
static void *poolrealloc_internal(PoolTy<PoolTraits> *Pool, void *Node,
unsigned NumBytes) {
- DO_IF_TRACE(fprintf(stderr, "[%d] poolrealloc(0x%X, %d) -> ",
- getPoolNumber(Pool), Node, NumBytes));
+ DO_IF_TRACE(fprintf(stderr, "[%d] poolrealloc%s(0x%X, %d) -> ",
+ getPoolNumber(Pool), PoolTraits::getSuffix(),
+ Node, NumBytes));
// If a null pool descriptor is passed in, this is not a pool allocated data
// structure. Hand off to the system realloc.
@@ -860,7 +862,7 @@
if (Pool->Slabs == 0)
return; // no memory allocated from this pool.
- DO_IF_TRACE(fprintf(stderr, "[%d] pooldestroy", removePoolNumber(Pool)));
+ DO_IF_TRACE(fprintf(stderr, "[%d] pooldestroy_pc", removePoolNumber(Pool)));
DO_IF_POOLDESTROY_STATS(PrintPoolStats(Pool));
// If there is space to remember this pool, do so.
Index: llvm-poolalloc/runtime/FL2Allocator/PoolAllocator.h
diff -u llvm-poolalloc/runtime/FL2Allocator/PoolAllocator.h:1.21 llvm-poolalloc/runtime/FL2Allocator/PoolAllocator.h:1.22
--- llvm-poolalloc/runtime/FL2Allocator/PoolAllocator.h:1.21 Thu Mar 3 22:03:30 2005
+++ llvm-poolalloc/runtime/FL2Allocator/PoolAllocator.h Fri Mar 4 15:23:55 2005
@@ -43,6 +43,7 @@
// Pointers are just pointers.
typedef FreedNodeHeader<NormalPoolTraits>* FreeNodeHeaderPtrTy;
+ static const char *getSuffix() { return ""; }
/// DerefFNHPtr - Given an index into the pool, return a pointer to the
/// FreeNodeHeader object.
@@ -74,6 +75,8 @@
// Represent pointers with indexes from the pool base.
typedef unsigned FreeNodeHeaderPtrTy;
+ static const char *getSuffix() { return "_pc"; }
+
/// DerefFNHPtr - Given an index into the pool, return a pointer to the
/// FreeNodeHeader object.
static FreedNodeHeader<CompressedPoolTraits>*
More information about the llvm-commits
mailing list