[svn:parrot] r48461 - branches/unshared_buffers/src/gc

darbelo at svn.parrot.org darbelo at svn.parrot.org
Fri Aug 13 17:09:01 UTC 2010


Author: darbelo
Date: Fri Aug 13 17:09:01 2010
New Revision: 48461
URL: https://trac.parrot.org/parrot/changeset/48461

Log:
Make sure we keep the free mem counters up to date in the buffer_pools.

Modified:
   branches/unshared_buffers/src/gc/alloc_resources.c

Modified: branches/unshared_buffers/src/gc/alloc_resources.c
==============================================================================
--- branches/unshared_buffers/src/gc/alloc_resources.c	Fri Aug 13 17:08:34 2010	(r48460)
+++ branches/unshared_buffers/src/gc/alloc_resources.c	Fri Aug 13 17:09:01 2010	(r48461)
@@ -488,6 +488,7 @@
                 if (Buffer_buflen(b) && PObj_is_movable_TESTALL(b)) {
                     Memory_Block *old_block = Buffer_pool(b);
 
+                    /* Skip mostly full blocks, think of them as pre-compacted */
                     if (!is_block_almost_full(old_block))
                         cur_spot = move_one_buffer(interp, new_block, b, cur_spot);
                 }
@@ -608,6 +609,9 @@
 
     Buffer_bufstart(old_buf) = new_pool_ptr;
 
+    /* Mark the memory as free in the old pool */
+    Buffer_pool(old_buf)->freed  += ALIGNED_STRING_SIZE(Buffer_buflen(old_buf));
+ 
     /* Remember new pool inside */
     *Buffer_poolptr(old_buf) = pool;
 


More information about the parrot-commits mailing list