entry_index = gcnumsrobjs_index;
}
BAMBOO_ENTER_RUNTIME_MODE_FROM_CLIENT();
- gccorestatus[BAMBOO_NUM_OF_CORE] = 0;
- gcnumsendobjs[entry_index][BAMBOO_NUM_OF_CORE] = gcself_numsendobjs;
- gcnumreceiveobjs[entry_index][BAMBOO_NUM_OF_CORE] = gcself_numreceiveobjs;
// check the status of all cores
if (gc_checkCoreStatus()) {
// ask for confirm
unsigned int blockindex;
BLOCKINDEX(blockindex, heaptop);
unsigned INTPTR localblocknum=GLOBALBLOCK2LOCAL(blockindex);
-
//this core is done as far as memory usage is concerned
returnedmem[cnum]=0;
unsigned INTPTR nextlocalblocknum=localblocknum+1;
for(;nextlocalblocknum<numblockspercore;nextlocalblocknum++) {
unsigned INTPTR blocknum=BLOCKINDEX2(cnum, nextlocalblocknum);
- struct blockrecord * nextblockrecord=&allocationinfo.blocktable[blockindex];
+ struct blockrecord * nextblockrecord=&allocationinfo.blocktable[blocknum];
nextblockrecord->status=BS_FREE;
nextblockrecord->usedspace=0;
//this is true because this cannot be the lowest block
if (objlength!=NOTMARKED) {
unsigned int length=ALIGNSIZETOBYTES(objlength);
+ //code between this and next comment should be removed
unsigned int size;
unsigned int type;
gettype_size(origptr, &type, &size);
if (size!=length) {
tprintf("BAD SIZE IN BITMAP: type=%u object=%x size=%u length=%u\n", type, origptr, size, length);
+ unsigned INTPTR alignsize=ALIGNOBJSIZE((unsigned INTPTR)(origptr-gcbaseva));
+ unsigned INTPTR hibits=alignsize>>4;
+ unsigned INTPTR lobits=(alignsize&15)<<1;
+ tprintf("hibits=%x lobits=%x\n", hibits, lobits);
+ tprintf("hi=%x lo=%x\n", gcmarktbl[hibits], gcmarktbl[hibits+1]);
+
}
-
+ //end of code to remove
+
void *endtoptr=toptr+length;
if (endtoptr>tobound) {
gccurr_heaptop-=(unsigned INTPTR)(toptr-toptrinit);
// NOTE: the objptr should not be NULL and should not be non shared ptr
#define updateObj(objptr) gcmappingtbl[OBJMAPPINGINDEX(objptr)]
//#define UPDATEOBJ(obj) {void *updatetmpptr=obj; if (updatetmpptr!=NULL) obj=updateObj(updatetmpptr);if (obj<gcbaseva) tprintf("BAD PTR %x to %x in %u\n", updatetmpptr, obj, __LINE__);}
-#define UPDATEOBJ(obj) {void *updatetmpptr=obj; if (updatetmpptr!=NULL) obj=updateObj(updatetmpptr);}
+#define UPDATEOBJ(obj) {void *updatetmpptr=obj; if (updatetmpptr!=NULL) {obj=updateObj(updatetmpptr);}}
+//if (obj==NULL) tprintf("Mapping problem for object %x, mark=%u, line=%u\n", updatetmpptr, getMarkedLength(updatetmpptr),__LINE__);}}
#define UPDATEOBJNONNULL(obj) {void *updatetmpptr=obj; obj=updateObj(updatetmpptr);}
+//if (updatetmpptr!=NULL&&obj==NULL) tprintf("Mapping parameter for object %x, mark=%u, line=%u\n", updatetmpptr, getMarkedLength(updatetmpptr),__LINE__);}
INLINE void updategarbagelist(struct garbagelist *listptr) {
for(;listptr!=NULL; listptr=listptr->next) {
memcpy(dstptr, origptr, length);
}
- // tprintf("Moving object %x to %x with length %u\n", origptr, dstptr, length);
+ //tprintf("Moving object %x to %x with length %u\n", origptr, dstptr, length);
/* Update the pointers in the object */
updatePtrsInObj(dstptr);
setLengthMarked(ptr,iunits);
- //tprintf("Marking object %x, type %u, length %u, units %u\n", ptr, type, size, iunits);
-
if(islarge) {
// ptr is a large object and not marked or enqueued
printf("NEED TO SUPPORT LARGE OBJECTS!\n");
#elif defined(SMEMG)
void *mem = globalmalloc_I(coren, isize, allocsize);
#endif
- // tprintf("Handing core %u memory block %x of size %u\n", coren, mem, *allocsize);
if(mem == NULL) {
// no enough shared global memory
// trigger gc
#ifdef GC_LARGESHAREDHEAP
#define BAMBOO_NUM_BLOCKS ((unsigned int)((GC_BAMBOO_NUMCORES)*(2+24)))
#elif defined MGC
-#define BAMBOO_NUM_BLOCKS ((unsigned int)((GC_BAMBOO_NUMCORES)*(72))) // 72M per core
+#define BAMBOO_NUM_BLOCKS ((unsigned int)((GC_BAMBOO_NUMCORES)*(3))) // 72M per core
#else
#define BAMBOO_NUM_BLOCKS ((unsigned int)((GC_BAMBOO_NUMCORES)*(2+14)))
#endif
#define BAMBOO_PAGE_SIZE ((unsigned int)(4 * 64 * 1024)) // 64K
#define BAMBOO_SMEM_SIZE ((unsigned int)(BAMBOO_PAGE_SIZE))
#elif defined MGC
-#define BAMBOO_SMEM_SIZE ((unsigned int)(16*(BAMBOO_PAGE_SIZE))) // 1M
+#define BAMBOO_SMEM_SIZE ((unsigned int)(2*(BAMBOO_PAGE_SIZE))) // 1M
#else
#define BAMBOO_SMEM_SIZE ((unsigned int)(4 * (BAMBOO_PAGE_SIZE)))
#endif // GC_LARGEPAGESIZE
#ifdef GC_LARGESHAREDHEAP
#define BAMBOO_NUM_BLOCKS ((unsigned int)((GC_BAMBOO_NUMCORES)*(2+5)))
#elif defined MGC
-#define BAMBOO_NUM_BLOCKS ((unsigned int)((GC_BAMBOO_NUMCORES)*72)) // 72M per core
+#define BAMBOO_NUM_BLOCKS ((unsigned int)((GC_BAMBOO_NUMCORES)*3)) // 72M per core
#else
#define BAMBOO_NUM_BLOCKS ((unsigned int)((GC_BAMBOO_NUMCORES)*(2+2))) //(15 * 1024) //(64 * 4 * 0.75) //(1024 * 1024 * 3.5) 3G
#endif
INLINE void processmsg_gcstartcompact_I() {
gcblock2fill = msgdata[msgdataindex];
MSG_INDEXINC_I();
+ BAMBOO_ASSERT(!gc_status_info.gcbusystatus);
gc_status_info.gcphase = COMPACTPHASE;
}
MSG_INDEXINC_I();
// received a mark phase finish msg
BAMBOO_ASSERT(BAMBOO_NUM_OF_CORE == STARTUPCORE);
+ BAMBOO_ASSERT(gc_status_info.gcphase = MARKPHASE);
// all cores should do mark
if(data1 < NUMCORESACTIVE) {