[sva-commits] r124896 - in /safecode/trunk/runtime: BitmapPoolAllocator/PoolSlab.cpp DebugRuntime/PoolAllocatorBitMask.cpp

Arushi Aggarwal aggarwa4 at illinois.edu
Fri Feb 4 15:09:29 CST 2011


Author: aggarwa4
Date: Fri Feb  4 15:09:29 2011
New Revision: 124896

URL: http://llvm.org/viewvc/llvm-project?rev=124896&view=rev
Log:
Added an assert.

Turn on registration for singleton objects.
 disabling because the code that does poolcheck for singleton
 objects, uses SearchForContainingSlab, which assumes it is being called
 from a poolfree, and does not handle pointers to the middle of an object

Modified:
    safecode/trunk/runtime/BitmapPoolAllocator/PoolSlab.cpp
    safecode/trunk/runtime/DebugRuntime/PoolAllocatorBitMask.cpp

Modified: safecode/trunk/runtime/BitmapPoolAllocator/PoolSlab.cpp
URL: http://llvm.org/viewvc/llvm-project/safecode/trunk/runtime/BitmapPoolAllocator/PoolSlab.cpp?rev=124896&r1=124895&r2=124896&view=diff
==============================================================================
--- safecode/trunk/runtime/BitmapPoolAllocator/PoolSlab.cpp (original)
+++ safecode/trunk/runtime/BitmapPoolAllocator/PoolSlab.cpp Fri Feb  4 15:09:29 2011
@@ -26,7 +26,7 @@
     Pool->NodeSize*getSlabSize(Pool);
   assert(Size <= PageSize && "Trying to allocate a slab larger than a page!");
   PoolSlab *PS = (PoolSlab*)AllocatePage();
-
+  assert(PS && "Allocating a page failed!");
   PS->NumNodesInSlab = NodesPerSlab;
   PS->isSingleArray = 0;  // Not a single array!
   PS->FirstUnused = 0;    // Nothing allocated.

Modified: safecode/trunk/runtime/DebugRuntime/PoolAllocatorBitMask.cpp
URL: http://llvm.org/viewvc/llvm-project/safecode/trunk/runtime/DebugRuntime/PoolAllocatorBitMask.cpp?rev=124896&r1=124895&r2=124896&view=diff
==============================================================================
--- safecode/trunk/runtime/DebugRuntime/PoolAllocatorBitMask.cpp (original)
+++ safecode/trunk/runtime/DebugRuntime/PoolAllocatorBitMask.cpp Fri Feb  4 15:09:29 2011
@@ -367,11 +367,14 @@
 void
 __sc_dbg_poolregister (DebugPoolTy *Pool, void * allocaptr,
                        unsigned NumBytes) {
-#if 1
+#if 0
   //
   // If this is a singleton object within a type-known pool, don't add it to
   // the splay tree.
   //
+  // FIXME: disabling because the code that does poolcheck for singleton
+  // objects, uses SearchForContainingSlab, which assumes it is being called
+  // from a poolfree, and does not handle pointers to the middle of an object.
   if (Pool && (NumBytes == Pool->NodeSize))
     return;
 #endif
@@ -407,14 +410,21 @@
   // allocation.  However, only do this if the object is not a singleton object
   // within a type-known pool.
   //
-  if (!(Pool && (NumBytes == Pool->NodeSize))) {
+
+  // FIXME: disabling because the code that does poolcheck for singleton
+  // objects, uses SearchForContainingSlab, which assumes it is being called
+  // from a poolfree, and does not handle pointers to the middle of an object.
+#if 0
+  if (Pool && (NumBytes == Pool->NodeSize)) {
+    return
+  }
+#endif
     _internal_poolregister (Pool,
                             allocaptr,
                             NumBytes, tag,
                             SourceFilep,
                             lineno,
                             Heap);
-  }
 
   //
   // Generate a generation number for this object registration.  We only do




More information about the sva-commits mailing list