[vmkit-commits] [vmkit] r59413 - in /vmkit/trunk: include/mvm/PrintBuffer.h lib/Mvm/GCMmap2/gccollector.h

Nicolas Geoffray nicolas.geoffray at lip6.fr
Sun Nov 16 03:04:59 PST 2008


Author: geoffray
Date: Sun Nov 16 05:04:58 2008
New Revision: 59413

URL: http://llvm.org/viewvc/llvm-project?rev=59413&view=rev
Log:
We can get rid of this extra header.


Modified:
    vmkit/trunk/include/mvm/PrintBuffer.h
    vmkit/trunk/lib/Mvm/GCMmap2/gccollector.h

Modified: vmkit/trunk/include/mvm/PrintBuffer.h
URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/include/mvm/PrintBuffer.h?rev=59413&r1=59412&r2=59413&view=diff

==============================================================================
--- vmkit/trunk/include/mvm/PrintBuffer.h (original)
+++ vmkit/trunk/include/mvm/PrintBuffer.h Sun Nov 16 05:04:58 2008
@@ -44,13 +44,13 @@
   /// alloc - Allocates a NativeString of size len.
   ///
   static inline NativeString *alloc(size_t len) {
-    return (NativeString *)gc::operator new(len, VT);
+    return (NativeString *)gc::operator new(len + sizeof(VirtualTable*), VT);
   }
 
   /// realloc - Reallocate a native string of size len.
   ///
   inline NativeString *realloc(size_t len) {
-    return (NativeString *)gc::realloc(len);
+    return (NativeString *)gc::realloc(len + sizeof(VirtualTable*));
   }
 
   /// setAt - Sets the char c at position pos in the NativeString.

Modified: vmkit/trunk/lib/Mvm/GCMmap2/gccollector.h
URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/Mvm/GCMmap2/gccollector.h?rev=59413&r1=59412&r2=59413&view=diff

==============================================================================
--- vmkit/trunk/lib/Mvm/GCMmap2/gccollector.h (original)
+++ vmkit/trunk/lib/Mvm/GCMmap2/gccollector.h Sun Nov 16 05:04:58 2008
@@ -150,7 +150,7 @@
       collect_unprotect();
     }
     
-    register GCChunkNode *header = allocator->alloc_chunk(n + sizeof(gc_header), 1, current_mark & 1);
+    register GCChunkNode *header = allocator->alloc_chunk(n, 1, current_mark & 1);
 #ifdef SERVICE
     VirtualMachine* vm = mvm::Thread::get()->vm;
     header->meta = vm;
@@ -187,7 +187,7 @@
       collect_unprotect();
     }
 
-    GCChunkNode  *res = allocator->realloc_chunk(desc, node, n+sizeof(gc_header));
+    GCChunkNode  *res = allocator->realloc_chunk(desc, node, n);
 
 #ifdef SERVICE
     VirtualMachine* vm = mvm::Thread::get()->vm;





More information about the vmkit-commits mailing list