[svn:parrot] r44115 - branches/sys_mem_reduce/src

bacek at svn.parrot.org bacek at svn.parrot.org
Wed Feb 17 20:43:02 UTC 2010


Author: bacek
Date: Wed Feb 17 20:43:01 2010
New Revision: 44115
URL: https://trac.parrot.org/parrot/changeset/44115

Log:
Switch object method cache to GC allocations.

Modified:
   branches/sys_mem_reduce/src/oo.c

Modified: branches/sys_mem_reduce/src/oo.c
==============================================================================
--- branches/sys_mem_reduce/src/oo.c	Wed Feb 17 20:42:44 2010	(r44114)
+++ branches/sys_mem_reduce/src/oo.c	Wed Feb 17 20:43:01 2010	(r44115)
@@ -749,7 +749,7 @@
 init_object_cache(PARROT_INTERP)
 {
     ASSERT_ARGS(init_object_cache)
-    Caches * const mc = interp->caches = mem_allocate_zeroed_typed(Caches);
+    Caches * const mc = interp->caches = mem_gc_allocate_zeroed_typed(interp, Caches);
     mc->idx = NULL;
 }
 
@@ -778,8 +778,8 @@
             invalidate_type_caches(interp, i);
     }
 
-    mem_sys_free(mc->idx);
-    mem_sys_free(mc);
+    mem_gc_free(interp, mc->idx);
+    mem_gc_free(interp, mc);
 }
 
 
@@ -963,14 +963,14 @@
                 sizeof (Meth_cache_entry ***) * mc->mc_size);
         }
         else {
-            mc->idx = mem_allocate_n_zeroed_typed(type + 1, Meth_cache_entry**);
+            mc->idx = mem_gc_allocate_n_zeroed_typed(interp, type + 1, Meth_cache_entry**);
         }
         mc->mc_size = type + 1;
     }
 
     if (mc->idx[type] == NULL) {
-        mc->idx[type] = (Meth_cache_entry **)mem_sys_allocate_zeroed(
-            sizeof (Meth_cache_entry *) * TBL_SIZE);
+        mc->idx[type] = mem_gc_allocate_n_zeroed_typed(interp,
+                TBL_SIZE, Meth_cache_entry*);
     }
 
     e   = mc->idx[type][bits];
@@ -981,7 +981,7 @@
 
     if (!e) {
         /* when here no or no correct entry was at [bits] */
-        e     = mem_allocate_typed(Meth_cache_entry);
+        e     = mem_gc_allocate_typed(interp, Meth_cache_entry);
 
         mc->idx[type][bits] = e;
 


More information about the parrot-commits mailing list