//@localPhase: the phase reside at the highest 32 bits. The other bits are zeros.
static inline int mark(void *ptr, unsigned long localPhase){
	mtype *h_ptr, mask;
	get_mark_params(ptr, &h_ptr, &mask);
	mtype old = *h_ptr;
	if(old&mask) return 0;
	return __mark(h_ptr, mask, old, localPhase);
}
Example #2
0
int main(int argc, char *argv[])
{
    QApplication a(argc, argv);
    __mark( M1, "Progra~, entry." );
    Launcher w;
    w.show();
    __elapsed( M1, "User code initialized in");
    return a.exec();
}
static inline void traceObj(void *cur, void **markstack, int *pcounter,
		unsigned long localSweep){
	mtype *h_ptr, mask, old;
	get_mark_params(cur, &h_ptr, &mask);
	old = *h_ptr;//read mark-bit word
	if(old&mask) //if is marked
		return;	//no need to trace

	markstack[0]=cur; //publish

	void *nxt = getChild(cur, CHILD1_OFFSET);
	if(nxt==NULL) {
		__mark(h_ptr, mask, old, localSweep);
	}
	else{
		markstack[*pcounter+1]=nxt;//By TSO this write comes after markstack[0]=cur;
		if(__mark(h_ptr, mask, old, localSweep)){
			(*pcounter)++;//commit previous write
		}
		else
			markstack[(*pcounter)+1]=NULL;
	}
}