[svn:parrot] r44462 - in branches/boehm_gc_2: lib/Parrot/Pmc2c src/gc

bacek at svn.parrot.org bacek at svn.parrot.org
Wed Feb 24 20:22:33 UTC 2010


Author: bacek
Date: Wed Feb 24 20:22:33 2010
New Revision: 44462
URL: https://trac.parrot.org/parrot/changeset/44462

Log:
Actually use typed allocation for CallContext.

Modified:
   branches/boehm_gc_2/lib/Parrot/Pmc2c/PMCEmitter.pm
   branches/boehm_gc_2/src/gc/gc_boehm.c

Modified: branches/boehm_gc_2/lib/Parrot/Pmc2c/PMCEmitter.pm
==============================================================================
--- branches/boehm_gc_2/lib/Parrot/Pmc2c/PMCEmitter.pm	Wed Feb 24 20:22:07 2010	(r44461)
+++ branches/boehm_gc_2/lib/Parrot/Pmc2c/PMCEmitter.pm	Wed Feb 24 20:22:33 2010	(r44462)
@@ -1133,7 +1133,7 @@
     #warn sprintf("%b %s\n", $result, Dumper($self->attributes));
 
     # We can't handle more than 32 bits on 32 bits plaform ATM.
-    return -1 if $result >= 2**32;
+    return '(UINTVAL)-1' if $result >= 2**32;
 
     return $result;
 }

Modified: branches/boehm_gc_2/src/gc/gc_boehm.c
==============================================================================
--- branches/boehm_gc_2/src/gc/gc_boehm.c	Wed Feb 24 20:22:07 2010	(r44461)
+++ branches/boehm_gc_2/src/gc/gc_boehm.c	Wed Feb 24 20:22:33 2010	(r44462)
@@ -303,7 +303,7 @@
 gc_boehm_allocate_pmc_header(PARROT_INTERP, UINTVAL flags)
 {
     boehm_gc_data *d = (boehm_gc_data*)interp->gc_sys->gc_private;
-    PMC *pmc = (PMC*)GC_malloc_explicitly_typed(sizeof(PMC), d->pmc_descriptor);
+    PMC *pmc = (PMC*)GC_MALLOC_EXPLICITLY_TYPED(sizeof(PMC), d->pmc_descriptor);
     //PMC *pmc = (PMC*)GC_MALLOC(sizeof(PMC));
     //GC_REGISTER_FINALIZER_NO_ORDER(pmc, gc_boehm_finalize_cb, interp, NULL, NULL);
     return pmc;
@@ -361,7 +361,7 @@
     void           *attrs;
 
     /* Lazy initialize bitmap for core PMCs */
-    if (base_type >= enum_class_core_max || attr_size / sizeof (GC_word)) {
+    if (base_type >= enum_class_core_max || pmc->vtable->attr_layout == (UINTVAL)-1) {
         attrs = GC_MALLOC(attr_size);
     }
     else {


More information about the parrot-commits mailing list