[llvm-commits] CVS: llvm-poolalloc/runtime/FL2Allocator/PoolAllocator.cpp
Changes in directory llvm-poolalloc/runtime/FL2Allocator: PoolAllocator.cpp updated: 1.54 - 1.55 --- Log message: Add a trace statement --- Diffs of the changes: (+1 -0) PoolAllocator.cpp |1 + 1 files changed, 1 insertion(+) Index: llvm-poolalloc/runtime/FL2Allocator/PoolAllocator.cpp diff -u llvm-poolalloc/runtime/FL2Allocator/PoolAllocator.cpp:1.54 llvm-poolalloc/runtime/FL2Allocator/PoolAllocator.cpp:1.55 --- llvm-poolalloc/runtime/FL2Allocator/PoolAllocator.cpp:1.54 Thu Jun 29 16:47:25 2006 +++ llvm-poolalloc/runtime/FL2Allocator/PoolAllocator.cpp Sun Sep 24 14:49:54 2006 @@ -666,6 +666,7 @@ // If we are not allowed to grow this pool, don't. if (!PoolTraits::CanGrowPool) { + DO_IF_TRACE(fprintf(stderr, Pool Overflow, not growable\n)); abort(); return 0; } ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm-poolalloc/runtime/FL2Allocator/PoolAllocator.cpp PoolAllocator.h
Changes in directory llvm-poolalloc/runtime/FL2Allocator: PoolAllocator.cpp updated: 1.53 - 1.54 PoolAllocator.h updated: 1.27 - 1.28 --- Log message: Add runtime support for an alternate pointer compression runtime --- Diffs of the changes: (+38 -1) PoolAllocator.cpp | 28 +++- PoolAllocator.h | 11 +++ 2 files changed, 38 insertions(+), 1 deletion(-) Index: llvm-poolalloc/runtime/FL2Allocator/PoolAllocator.cpp diff -u llvm-poolalloc/runtime/FL2Allocator/PoolAllocator.cpp:1.53 llvm-poolalloc/runtime/FL2Allocator/PoolAllocator.cpp:1.54 --- llvm-poolalloc/runtime/FL2Allocator/PoolAllocator.cpp:1.53 Wed Jun 14 16:17:32 2006 +++ llvm-poolalloc/runtime/FL2Allocator/PoolAllocator.cpp Thu Jun 29 16:47:25 2006 @@ -889,7 +889,6 @@ // next time. static PoolSlabCompressedPoolTraits *Pools[4] = { 0, 0, 0, 0 }; - void *poolinit_pc(PoolTyCompressedPoolTraits *Pool, unsigned DeclaredSize, unsigned ObjAlignment) { poolinit_internal(Pool, DeclaredSize, ObjAlignment); @@ -980,6 +979,33 @@ return (char*)Result-(char*)Pool-Slabs; } +// Alternate Pointer Compression +void *poolinit_pca(PoolTyCompressedPoolTraits *Pool, unsigned NodeSize, + unsigned ObjAlignment) +{ + return poolinit_pc(Pool, NodeSize, ObjAlignment); +} + +void pooldestroy_pca(PoolTyCompressedPoolTraits *Pool) +{ + pooldestroy_pc(Pool); +} + +void* poolalloc_pca(PoolTyCompressedPoolTraits *Pool, unsigned NumBytes) +{ + return poolalloc_internal(Pool, NumBytes); +} + +void poolfree_pca(PoolTyCompressedPoolTraits *Pool, void* Node) +{ + poolfree_internal(Pool, Node); +} + +void* poolrealloc_pca(PoolTyCompressedPoolTraits *Pool, void* Node, + unsigned NumBytes) +{ + return poolrealloc_internal(Pool, Node, NumBytes); +} //===--===// // Access Tracing Runtime Library Support Index: llvm-poolalloc/runtime/FL2Allocator/PoolAllocator.h diff -u llvm-poolalloc/runtime/FL2Allocator/PoolAllocator.h:1.27 llvm-poolalloc/runtime/FL2Allocator/PoolAllocator.h:1.28 --- llvm-poolalloc/runtime/FL2Allocator/PoolAllocator.h:1.27Wed Jun 14 16:17:32 2006 +++ llvm-poolalloc/runtime/FL2Allocator/PoolAllocator.h Thu Jun 29 16:47:25 2006 @@ -215,6 +215,17 @@ unsigned long long poolrealloc_pc(PoolTyCompressedPoolTraits *Pool, unsigned long long Node, unsigned NumBytes); + // Alternate Pointer Compression runtime library. Most of these are just + // wrappers around the normal pool routines. + void *poolinit_pca(PoolTyCompressedPoolTraits *Pool, unsigned NodeSize, +unsigned ObjAlignment); + void pooldestroy_pca(PoolTyCompressedPoolTraits *Pool); + void* poolalloc_pca(PoolTyCompressedPoolTraits *Pool, + unsigned NumBytes); + void poolfree_pca(PoolTyCompressedPoolTraits *Pool, void* Node); + void* poolrealloc_pca(PoolTyCompressedPoolTraits *Pool, + void* Node, unsigned NumBytes); + // Access tracing runtime library support. void poolaccesstraceinit(void); void poolaccesstrace(void *Ptr, void *PD); ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm-poolalloc/runtime/FL2Allocator/PoolAllocator.cpp PoolAllocator.h
Changes in directory llvm-poolalloc/runtime/FL2Allocator: PoolAllocator.cpp updated: 1.51 - 1.52 PoolAllocator.h updated: 1.25 - 1.26 --- Log message: realloc_pc --- Diffs of the changes: (+16 -7) PoolAllocator.cpp | 20 ++-- PoolAllocator.h |3 ++- 2 files changed, 16 insertions(+), 7 deletions(-) Index: llvm-poolalloc/runtime/FL2Allocator/PoolAllocator.cpp diff -u llvm-poolalloc/runtime/FL2Allocator/PoolAllocator.cpp:1.51 llvm-poolalloc/runtime/FL2Allocator/PoolAllocator.cpp:1.52 --- llvm-poolalloc/runtime/FL2Allocator/PoolAllocator.cpp:1.51 Thu Feb 16 09:50:09 2006 +++ llvm-poolalloc/runtime/FL2Allocator/PoolAllocator.cpp Thu Apr 27 10:50:02 2006 @@ -538,9 +538,11 @@ } templatetypename PoolTraits -static void *poolalloc_internal(PoolTyPoolTraits *Pool, unsigned NumBytes) { +static void *poolalloc_internal(PoolTyPoolTraits *Pool, unsigned NumBytesA) { DO_IF_TRACE(fprintf(stderr, [%d] poolalloc%s(%d) - , - getPoolNumber(Pool), PoolTraits::getSuffix(), NumBytes)); + getPoolNumber(Pool), PoolTraits::getSuffix(), NumBytesA)); + + int NumBytes = NumBytesA; // If a null pool descriptor is passed in, this is not a pool allocated data // structure. Hand off to the system malloc. @@ -783,9 +785,9 @@ DO_IF_TRACE(fprintf(stderr, 0x%X (system realloc)\n, Result)); return Result; } - if (Node == 0) return poolalloc(Pool, NumBytes); + if (Node == 0) return poolalloc_internal(Pool, NumBytes); if (NumBytes == 0) { -poolfree(Pool, Node); +poolfree_internal(Pool, Node); DO_IF_TRACE(fprintf(stderr, freed\n)); return 0; } @@ -797,12 +799,12 @@ if (Size != ~1U) { // FIXME: This is obviously much worse than it could be. In particular, we // never try to expand something in a pool. This might hurt some programs! -void *New = poolalloc(Pool, NumBytes); +void *New = poolalloc_internal(Pool, NumBytes); assert(New != 0 Our poolalloc doesn't ever return null for failure!); // Copy the min of the new and old sizes over. memcpy(New, Node, Size NumBytes ? Size : NumBytes); -poolfree(Pool, Node); +poolfree_internal(Pool, Node); DO_IF_TRACE(fprintf(stderr, 0x%X (moved)\n, New)); return New; } @@ -972,6 +974,12 @@ poolfree_internal(Pool, (char*)Pool-Slabs+Node); } +unsigned long long poolrealloc_pc(PoolTyCompressedPoolTraits *Pool, + unsigned long long Node, unsigned NumBytes) { + void *Result = poolrealloc_internal(Pool, (char*)Pool-Slabs+Node, NumBytes); + return (char*)Result-(char*)Pool-Slabs; +} + //===--===// // Access Tracing Runtime Library Support Index: llvm-poolalloc/runtime/FL2Allocator/PoolAllocator.h diff -u llvm-poolalloc/runtime/FL2Allocator/PoolAllocator.h:1.25 llvm-poolalloc/runtime/FL2Allocator/PoolAllocator.h:1.26 --- llvm-poolalloc/runtime/FL2Allocator/PoolAllocator.h:1.25Wed May 18 14:56:30 2005 +++ llvm-poolalloc/runtime/FL2Allocator/PoolAllocator.h Thu Apr 27 10:50:02 2006 @@ -212,7 +212,8 @@ unsigned NumBytes); void poolfree_pc(PoolTyCompressedPoolTraits *Pool, unsigned long long Node); //void *poolmemalign_pc(PoolTy *Pool, unsigned Alignment, unsigned NumBytes); - + unsigned long long poolrealloc_pc(PoolTyCompressedPoolTraits *Pool, + unsigned long long Node, unsigned NumBytes); // Access tracing runtime library support. void poolaccesstraceinit(void); ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm-poolalloc/runtime/FL2Allocator/PoolAllocator.cpp
Changes in directory llvm-poolalloc/runtime/FL2Allocator: PoolAllocator.cpp updated: 1.50 - 1.51 --- Log message: some programs call memalign, so there should be one --- Diffs of the changes: (+7 -0) PoolAllocator.cpp |7 +++ 1 files changed, 7 insertions(+) Index: llvm-poolalloc/runtime/FL2Allocator/PoolAllocator.cpp diff -u llvm-poolalloc/runtime/FL2Allocator/PoolAllocator.cpp:1.50 llvm-poolalloc/runtime/FL2Allocator/PoolAllocator.cpp:1.51 --- llvm-poolalloc/runtime/FL2Allocator/PoolAllocator.cpp:1.50 Fri May 27 15:46:20 2005 +++ llvm-poolalloc/runtime/FL2Allocator/PoolAllocator.cpp Thu Feb 16 09:50:09 2006 @@ -854,6 +854,13 @@ return poolalloc_internal(Pool, NumBytes); } +void *poolmemalign(PoolTyNormalPoolTraits *Pool, + unsigned Alignment, unsigned NumBytes) { + //punt and use pool alloc. + //I don't know if this is safe or breaks any assumptions in the runtime + intptr_t base = (intptr_t)poolalloc_internal(Pool, NumBytes + Alignment - 1); + return (void*)((base + (Alignment - 1)) ~((intptr_t)Alignment -1)); +} void poolfree(PoolTyNormalPoolTraits *Pool, void *Node) { DO_IF_FORCE_MALLOCFREE(free(Node); return); ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits