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

bacek at svn.parrot.org bacek at svn.parrot.org
Wed Feb 17 20:40:27 UTC 2010


Author: bacek
Date: Wed Feb 17 20:40:27 2010
New Revision: 44108
URL: https://trac.parrot.org/parrot/changeset/44108

Log:
Switch BigInt PMC to GC allocations

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

Modified: branches/sys_mem_reduce/src/pmc/bigint.pmc
==============================================================================
--- branches/sys_mem_reduce/src/pmc/bigint.pmc	Wed Feb 17 20:40:06 2010	(r44107)
+++ branches/sys_mem_reduce/src/pmc/bigint.pmc	Wed Feb 17 20:40:27 2010	(r44108)
@@ -47,7 +47,7 @@
     BIGINT * bi;
     GETATTR_BigInt_bi(interp, self, bi);
     mpz_clear(bi->b);
-    mem_sys_free(bi);
+    gc_mem_free(interp, bi);
 }
 
 static void
@@ -123,7 +123,7 @@
 
     GETATTR_BigInt_bi(interp, self, bi);
     n = mpz_sizeinbase(bi->b, base) + 2;
-    s = (char *)mem_sys_allocate(n);
+    s = gc_mem_allocate_n_typed(interp, n, char);
     return mpz_get_str(s, base, bi->b);
 }
 
@@ -679,14 +679,14 @@
     VTABLE STRING *get_string() {
         char   * const s  = bigint_get_string(INTERP, SELF, 10);
         STRING * const ps = Parrot_str_new(INTERP, s, 0);
-        mem_sys_free(s);
+        gc_mem_free(INTERP, s);
         return ps;
     }
 
     VTABLE STRING *get_string_keyed_int(INTVAL base) {
         char   * const s  = bigint_get_string(INTERP, SELF, base);
         STRING * const ps = Parrot_str_new(INTERP, s, 0);
-        mem_sys_free(s);
+        gc_mem_free(INTERP, s);
         return ps;
     }
 


More information about the parrot-commits mailing list