[vmkit-commits] [vmkit] r60537 - /vmkit/trunk/lib/Mvm/GCMmap2/gccollector.h

Nicolas Geoffray nicolas.geoffray at lip6.fr
Thu Dec 4 06:22:46 PST 2008


Author: geoffray
Date: Thu Dec  4 08:22:41 2008
New Revision: 60537

URL: http://llvm.org/viewvc/llvm-project?rev=60537&view=rev
Log:
[SERVICE] Also look at a v limit in realloc.


Modified:
    vmkit/trunk/lib/Mvm/GCMmap2/gccollector.h

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

==============================================================================
--- vmkit/trunk/lib/Mvm/GCMmap2/gccollector.h (original)
+++ vmkit/trunk/lib/Mvm/GCMmap2/gccollector.h Thu Dec  4 08:22:41 2008
@@ -162,7 +162,7 @@
     if (threads->get_nb_threads()) {
       VirtualMachine* vm = mvm::Thread::get()->MyVM;
       if (vm->memoryUsed + n > vm->memoryLimit) {
-        fprintf(stderr, "Limite atteinte, tue le bundle\n");
+        _since_last_collection += n;
         unlock();
         vm->stopService();
         return 0;
@@ -216,6 +216,18 @@
       collect_unprotect();
     }
 
+#ifdef SERVICE
+    if (threads->get_nb_threads()) {
+      VirtualMachine* vm = mvm::Thread::get()->MyVM;
+      if (vm->memoryUsed + (n - old_sz) > vm->memoryLimit) {
+        _since_last_collection += (n - old_sz);
+        unlock();
+        vm->stopService();
+        return 0;
+      }
+    }
+#endif
+
     GCChunkNode  *res = allocator->realloc_chunk(desc, node, n);
 
 #ifdef SERVICE





More information about the vmkit-commits mailing list