[svn:parrot] r43214 - trunk/src/gc

plobsing at svn.parrot.org plobsing at svn.parrot.org
Tue Dec 22 16:57:56 UTC 2009


Author: plobsing
Date: Tue Dec 22 16:57:55 2009
New Revision: 43214
URL: https://trac.parrot.org/parrot/changeset/43214

Log:
make guaranteed_reclaimable and possibly_reclaimable disjoint

Modified:
   trunk/src/gc/api.c
   trunk/src/gc/mark_sweep.c

Modified: trunk/src/gc/api.c
==============================================================================
--- trunk/src/gc/api.c	Tue Dec 22 16:33:12 2009	(r43213)
+++ trunk/src/gc/api.c	Tue Dec 22 16:57:55 2009	(r43214)
@@ -691,10 +691,11 @@
 
     if (!PObj_COW_TEST(buffer))
         pool->guaranteed_reclaimable += copysize;
+    else
+        pool->possibly_reclaimable   += copysize;
 
-    pool->possibly_reclaimable += copysize;
-    mem                         = (char *)mem_allocate(interp, new_size, pool);
-    mem                         = aligned_mem(buffer, mem);
+    mem = (char *)mem_allocate(interp, new_size, pool);
+    mem = aligned_mem(buffer, mem);
 
     /* We shouldn't ever have a 0 from size, but we do. If we can track down
      * those bugs, this can be removed which would make things cheaper */
@@ -805,8 +806,8 @@
 
     if (!PObj_COW_TEST(str))
         pool->guaranteed_reclaimable += Buffer_buflen(str);
-
-    pool->possibly_reclaimable += Buffer_buflen(str);
+    else
+        pool->possibly_reclaimable   += Buffer_buflen(str);
 
     mem = (char *)mem_allocate(interp, new_size, pool);
     mem += sizeof (void *);

Modified: trunk/src/gc/mark_sweep.c
==============================================================================
--- trunk/src/gc/mark_sweep.c	Tue Dec 22 16:33:12 2009	(r43213)
+++ trunk/src/gc/mark_sweep.c	Tue Dec 22 16:57:55 2009	(r43214)
@@ -738,11 +738,11 @@
     if (mem_pool) {
         if (!PObj_COW_TEST(b))
             mem_pool->guaranteed_reclaimable += Buffer_buflen(b);
-
-        mem_pool->possibly_reclaimable += Buffer_buflen(b);
+        else
+            mem_pool->possibly_reclaimable   += Buffer_buflen(b);
     }
 
-    Buffer_buflen(b)        = 0;
+    Buffer_buflen(b) = 0;
 }
 
 


More information about the parrot-commits mailing list