Author: kjs
Date: Sun Dec 14 08:32:48 2008
New Revision: 33887

Modified:
   trunk/compilers/pirc/new/pirregalloc.c

Log:
[pirc] free memory of cached objects.

Modified: trunk/compilers/pirc/new/pirregalloc.c
==============================================================================
--- trunk/compilers/pirc/new/pirregalloc.c      (original)
+++ trunk/compilers/pirc/new/pirregalloc.c      Sun Dec 14 08:32:48 2008
@@ -98,6 +98,7 @@
 void
 destroy_linear_scan_regiser_allocator(lsr_allocator *lsr) {
     pir_type type;
+    live_interval *i;
 
     for (type = 0; type < 4; ++type) {
         live_interval *iter = lsr->intervals[type];
@@ -107,6 +108,14 @@
         }
     }
 
+    /* free all cached interval objects */
+    i = lsr->cached_intervals;
+    while (i != NULL) {
+        live_interval *tmp = i;
+        i = i->nextc;
+        mem_sys_free(tmp);
+    }
+
     mem_sys_free(lsr);
 }
 

Reply via email to