[svn:parrot] r39105 - trunk/compilers/imcc

chromatic at svn.parrot.org chromatic at svn.parrot.org
Sat May 23 19:45:26 UTC 2009


Author: chromatic
Date: Sat May 23 19:45:26 2009
New Revision: 39105
URL: https://trac.parrot.org/parrot/changeset/39105

Log:
[IMCC] Plugged a pesky memory leak when reallocating the opcode array in an
mmap()ed PackFile_Segment.  This may still leak mmap()ed memory, so it warrants
better encapsulation of the "Resize this storage" operation somewhere in
src/packfile.c.  It's still an improvement though; I've chased this one for
ages.

Modified:
   trunk/compilers/imcc/pbc.c

Modified: trunk/compilers/imcc/pbc.c
==============================================================================
--- trunk/compilers/imcc/pbc.c	Sat May 23 19:17:25 2009	(r39104)
+++ trunk/compilers/imcc/pbc.c	Sat May 23 19:45:26 2009	(r39105)
@@ -2146,6 +2146,9 @@
         interp->code->base.data       = (opcode_t *)
             mem_sys_realloc(interp->code->base.data, bytes);
 
+        /* reallocating this removes its mmaped-ness; needs encapsulation */
+        interp->code->base.pf->is_mmap_ped = 0;
+
         interp->code->pic_index->data = (opcode_t *)
             mem_sys_realloc(interp->code->pic_index->data, bytes / 2);
 
@@ -2157,7 +2160,7 @@
 
         /* add debug if necessary */
         if (IMCC_INFO(interp)->optimizer_level == 0
-        || IMCC_INFO(interp)->optimizer_level  == OPT_PASM) {
+        ||  IMCC_INFO(interp)->optimizer_level == OPT_PASM) {
             const char * const sourcefile = unit->file;
 
             /* FIXME length and multiple subs */


More information about the parrot-commits mailing list