[svn:parrot] r44263 - branches/sys_mem_reduce/src/pmc

bacek at svn.parrot.org bacek at svn.parrot.org
Sun Feb 21 00:12:17 UTC 2010


Author: bacek
Date: Sun Feb 21 00:12:16 2010
New Revision: 44263
URL: https://trac.parrot.org/parrot/changeset/44263

Log:
Explicitely clean allocated memory in FBA.

Modified:
   branches/sys_mem_reduce/src/pmc/fixedbooleanarray.pmc

Modified: branches/sys_mem_reduce/src/pmc/fixedbooleanarray.pmc
==============================================================================
--- branches/sys_mem_reduce/src/pmc/fixedbooleanarray.pmc	Sat Feb 20 23:38:13 2010	(r44262)
+++ branches/sys_mem_reduce/src/pmc/fixedbooleanarray.pmc	Sun Feb 21 00:12:16 2010	(r44263)
@@ -330,6 +330,7 @@
     VTABLE void set_integer_native(INTVAL size) {
         const size_t size_in_bytes = get_size_in_bytes(size);
         UINTVAL old_size;
+        unsigned char *bit_array;
 
         GET_ATTR_size(INTERP, SELF, old_size);
 
@@ -339,8 +340,9 @@
 
         SET_ATTR_size(INTERP, SELF, size);
         SET_ATTR_resize_threshold(INTERP, SELF, size_in_bytes * BITS_PER_CHAR);
-        SET_ATTR_bit_array(INTERP, SELF,
-                mem_gc_allocate_n_typed(INTERP, size_in_bytes, unsigned char));
+        bit_array = mem_gc_allocate_n_typed(INTERP, size_in_bytes, unsigned char);
+        memset(bit_array, 0, size_in_bytes);
+        SET_ATTR_bit_array(INTERP, SELF, bit_array);
     }
 
 /*


More information about the parrot-commits mailing list