#ifdef GC_CACHE_ADAPT
void *origbound=orig->pagebound;
void *tobound=to->pagebound;
+ //set to the first line so we don't need conditions
+ void *lastflush=(&gcmappingtbl[OBJMAPPINGINDEX(origptr)])&~(BAMBOO_CACHE_LINE_MASK);
#else
void *origbound=orig->bound;
void *tobound=to->bound;
to->ptr=toptr;
orig->ptr=origbound;
gccurr_heaptop-=(unsigned INTPTR)(toptr-toptrinit);
+#ifdef GC_CACHE_ADAPT
+ BAMBOO_CACHE_FLUSH_LINE(lastflush);
+#endif
return 0;
}
} while(!gcmarktbl[arrayoffset]);
gccurr_heaptop-=(unsigned INTPTR)(toptr-toptrinit);
to->ptr=toptr;
orig->ptr=origptr;
+#ifdef GC_CACHE_ADAPT
+ BAMBOO_CACHE_FLUSH_LINE(lastflush);
+#endif
return length;
}
//good to move objects and update pointers
- gcmappingtbl[OBJMAPPINGINDEX(origptr)]=toptr;
-
+ void ** mapptr=&gcmappingtbl[OBJMAPPINGINDEX(origptr)];
+ *mapptr=toptr;
+
+#ifdef GC_CACHE_ADAPT
+ void *maskmapptr=mapptr&~(BAMBOO_CACHE_LINE_MASK);
+
+ if (lastflush!=maskmapptr) {
+ BAMBOO_CACHE_FLUSH_LINE(lastflush);
+ lastflush=maskmapptr;
+ }
+#endif
+
origptr+=length;
toptr=endtoptr;
} else
to->ptr=toptr;
orig->ptr=origptr;
gccurr_heaptop-=(unsigned INTPTR)(toptr-toptrinit);
+#ifdef GC_CACHE_ADAPT
+ BAMBOO_CACHE_FLUSH_LINE(lastflush);
+#endif
return 0;
}
initOrig_Dst(&orig, &to);
compacthelper(&orig, &to);
+#ifdef GC_CACHE_ADAPT
+ BAMBOO_CACHE_MF();
+#endif
}
void master_compact() {