some changes towards compilation
authorbdemsky <bdemsky>
Thu, 7 Jul 2011 00:54:16 +0000 (00:54 +0000)
committerbdemsky <bdemsky>
Thu, 7 Jul 2011 00:54:16 +0000 (00:54 +0000)
Robust/src/Runtime/bamboo/pmc_forward.c
Robust/src/Runtime/bamboo/pmc_garbage.c
Robust/src/Runtime/bamboo/pmc_mark.c
Robust/src/Runtime/bamboo/pmc_mem.c
Robust/src/Runtime/bamboo/pmc_refupdate.c

index 94d3fd90f1e5f5a05dd7bea562b2accb3f9b9bba..dcf767b02589acee802e691e8908302b5f5d5406 100644 (file)
@@ -8,8 +8,8 @@ void pmc_count() {
   for(int i=0;i<NUMPMCUNITS;i++) {
     if (!tmc_spin_mutex_trylock(&pmc_heapptr->units[i].lock)) {
       //got lock
-      void *unitbase=(i==0)?gcbaseva:pmc_heapptr->units[i-1]->endptr;
-      void *unittop=pmc_heapptr->units[i]->endptr;
+      void *unitbase=(i==0)?gcbaseva:pmc_heapptr->units[i-1].endptr;
+      void *unittop=pmc_heapptr->units[i].endptr;
       pmc_countbytes(&pmc_heapptr->units[i], unitbase, unittop);
     }
   }
@@ -143,7 +143,7 @@ void pmc_forward(struct pmc_region *region, unsigned int totalbytes, void *botto
 
       forwardptr=newforwardptr;
       if (lastobj&&!fwddirection) {
-       tmpptr->backward=lastobj;
+       ((struct ___Object___ *)tmpptr)->backward=lastobj;
        lastobj=(struct ___Object___ *)tmpptr;
       }
     }
index 46285737b78aade7257f5c42ddb24f9452ce399d..65264f27d2acb48aeab9851c5d7e490154782357 100644 (file)
@@ -1,6 +1,6 @@
-#include "pmc_garbage.h"
 #include "multicoregc.h"
-#inclued "runtime_arch.h"
+#include "pmc_garbage.h"
+#include "runtime_arch.h"
 
 struct pmc_queue * pmc_localqueue;
 
@@ -21,7 +21,7 @@ void * pmc_unitend(unsigned int index) {
 }
 
 void pmc_onceInit() {
-  pmc_localqueue=&pmc_heapptr->regions[BAMBOO_NUM_OF_THREADS].markqueue;
+  pmc_localqueue=&pmc_heapptr->regions[BAMBOO_NUM_OF_CORE].markqueue;
   pmc_queueinit(pmc_localqueue);
   tmc_spin_barrier_init(&pmc_heapptr->barrier, NUMCORES4GC);
   for(int i=0;i<NUMPMCUNITS;i++) {
@@ -30,7 +30,7 @@ void pmc_onceInit() {
 }
 
 void pmc_init() {
-  if (BAMBOO_NUM_OF_THREADS==STARTUPCORE) {
+  if (BAMBOO_NUM_OF_CORE==STARTUPCORE) {
     pmc_heapptr->numthreads=NUMCORES4GC;
   }
   tmc_spin_barrier_wait(&pmc_heapptr->barrier);
@@ -44,7 +44,7 @@ void gc(struct garbagelist *gl) {
   pmc_count();
   tmc_spin_barrier_wait(&pmc_heapptr->barrier);
   //divide up work
-  if (BAMBOO_NUM_OF_THREADS==STARTUPCORE) {
+  if (BAMBOO_NUM_OF_CORE==STARTUPCORE) {
     pmc_processunits();
   }
   tmc_spin_barrier_wait(&pmc_heapptr->barrier);
index dc933ed0460e09d9d89b372824ed3fd8509cd235..66413aa31e7470ebf68f69d5065494ba2f449db2 100644 (file)
@@ -2,6 +2,8 @@
 #include "pmc_garbage.h"
 #include "multicoremgc.h"
 #include <stdlib.h>
+#include "runtime.h"
+#include "thread.h"
 
 #define PMC_MARKOBJ(objptr) {void * marktmpptr=objptr; if (marktmpptr!=NULL) {pmc_markObj(marktmpptr);}}
 
index 6179a3b7aaf37f74b64de17e36a15b9aef0b5246..a53fb4ba8da8fb966a90bc411112ec21fecf2364 100644 (file)
@@ -1,3 +1,4 @@
+#include <stdlib.h>
 #include "pmc_garbage.h"
 #include "pmc_mem.h"
 
@@ -17,7 +18,7 @@ void * pmc_alloc(unsigned int * numbytesallocated, unsigned int minimumbytes) {
        if ((finishptr-startptr)<memcheck)
          break;
        unsigned int startindex=region->lowunit;
-       unsigned int endindex=pmc_heapptr->regions[i+1]->highunit;
+       unsigned int endindex=pmc_heapptr->regions[i+1].highunit;
        void * newstartptr=startptr+memcheck;
        
        //update unit end points
index be58e88cc30209b7d25b009f8c726537924b423f..d6ccf46016c50d1a6fdf1962786458337f437f3b 100644 (file)
@@ -1,5 +1,7 @@
 #include <stdlib.h>
 #include "structdefs.h"
+#include "bambooalign.h"
+#include "runtime_arch.h"
 #include "pmc_forward.h"
 #include "pmc_refupdate.h"
 
@@ -80,14 +82,14 @@ void pmc_compact(struct pmc_region * region, int forward, void *bottomptr, void
       tmpptr+=size;
     }
   } else {
-    struct ___Object___ *backward=region->lastobj;
+    struct ___Object___ *backward=((struct ___Object___ *) region)->backward;
     struct ___Object___ *lastobj=NULL;
     while(backward) {
       lastobj=backward;
-      backward=backward->lastobj;
+      backward=backward->backward;
       unsigned int type;
       unsigned int size;
-      gettype_size(tmpptr, &type, &size);
+      gettype_size(lastobj, &type, &size);
       void *forwardptr=(void *)((struct ___Object___ *) lastobj)->marked;
       ((struct ___Object___ *) lastobj)->marked=NULL;
       if (forwardptr) {