[svn:parrot] r49738 - branches/gc_ms2_sf/src/gc

chromatic at svn.parrot.org chromatic at svn.parrot.org
Sat Oct 30 23:06:11 UTC 2010


Author: chromatic
Date: Sat Oct 30 23:06:11 2010
New Revision: 49738
URL: https://trac.parrot.org/parrot/changeset/49738

Log:
[GC] Removed constant PMCs from memory statistics.

Because constant PMC memory is unreclaimable, there's little point in running
the GC to attempt to free this memory.  This should improve GC throughput
somewhat.

Modified:
   branches/gc_ms2_sf/src/gc/gc_ms2.c

Modified: branches/gc_ms2_sf/src/gc/gc_ms2.c
==============================================================================
--- branches/gc_ms2_sf/src/gc/gc_ms2.c	Sat Oct 30 23:06:08 2010	(r49737)
+++ branches/gc_ms2_sf/src/gc/gc_ms2.c	Sat Oct 30 23:06:11 2010	(r49738)
@@ -729,16 +729,16 @@
 
     /* Increase used memory. Not precisely accurate due Pool_Allocator paging */
     ++interp->gc_sys->stats.header_allocs_since_last_collect;
-
-    interp->gc_sys->stats.memory_allocated      += sizeof (PMC);
-    interp->gc_sys->stats.mem_used_last_collect += sizeof (PMC);
-
     ptr = (List_Item_Header *)Parrot_gc_pool_allocate(interp, pool);
+
     if (flags & PObj_constant_FLAG) {
         LIST_APPEND(self->constants, ptr);
     }
     else {
+        /* only reclaimable PMCs count toward memory limits */
         LIST_APPEND(self->objects, ptr);
+        interp->gc_sys->stats.memory_allocated      += sizeof (PMC);
+        interp->gc_sys->stats.mem_used_last_collect += sizeof (PMC);
     }
 
     return LLH2Obj_typed(ptr, PMC);


More information about the parrot-commits mailing list