qitem=qitem->next;
continue;
}
- struct garbagelist * gl=(struct garbagelist *)&(((SESEcommon*)(qitem->value))[1]);
+ SESEcommon* seseRec = (SESEcommon*)(qitem->value);
+ struct garbagelist * gl=(struct garbagelist *)&(seseRec[1]);
struct garbagelist * glroot=gl;
// update its ascendant SESEs
- updateAscendantSESE(gl);
+ updateAscendantSESE(seseRec);
while(gl!=NULL) {
int i;
struct QueueItem * fqItem=getHead(forwardList);
while(fqItem!=NULL){
- struct garbagelist * gl=(struct garbagelist *)&(((SESEcommon*)(fqItem->objectptr))[1]);
+ SESEcommon* seseRec = (SESEcommon*)(fqItem->objectptr);
+ struct garbagelist * gl=(struct garbagelist *)&(seseRec[1]);
if(prevUpdate==TRUE){
- updateAscendantSESE(gl);
+ updateAscendantSESE(seseRec);
}
// do something here
while(gl!=NULL) {
int i;
- for(i=0; i<gl->size; i++) {
- void * orig=gl->array[i];
- ENQUEUE(orig, gl->array[i]);
- }
- gl=gl->next;
+ for(i=0; i<gl->size; i++) {
+ void * orig=gl->array[i];
+ ENQUEUE(orig, gl->array[i]);
+ }
+ gl=gl->next;
}
- // iterate forwarding list of seseRec
- SESEcommon *common=(SESEcommon*)fqItem->objectptr;
- struct Queue* fList=common->forwardList;
+ // iterate forwarding list of seseRec
+ struct Queue* fList=seseRec->forwardList;
updateForwardList(fList,prevUpdate);
fqItem=getNextQueueItem(fqItem);
}
ReadBinItem* readBinItem=(ReadBinItem*)binItem;
int ridx;
for(ridx=0; ridx<readBinItem->index; ridx++){
- REntry *rentry=readBinItem->array[ridx];
- struct garbagelist * gl= (struct garbagelist *)&(((SESEcommon*)(rentry->seseRec))[1]);
- updateAscendantSESE(gl);
+ REntry *rentry=readBinItem->array[ridx];
+ SESEcommon* seseRec = (SESEcommon*)(rentry->seseRec);
+ struct garbagelist * gl= (struct garbagelist *)&(seseRec[1]);
+ updateAscendantSESE(seseRec);
while(gl!=NULL) {
int i;
for(i=0; i<gl->size; i++) {
}
}else{ //writebin
REntry *rentry=((WriteBinItem*)binItem)->val;
- struct garbagelist * gl= (struct garbagelist *)&(((SESEcommon*)(rentry->seseRec))[1]);
- updateAscendantSESE(gl);
+ SESEcommon* seseRec = (SESEcommon*)(rentry->seseRec);
+ struct garbagelist * gl= (struct garbagelist *)&(seseRec[1]);
+ updateAscendantSESE(seseRec);
while(gl!=NULL) {
int i;
for(i=0; i<gl->size; i++) {
for(idx=0; idx<vt->index; idx++){
REntry *rentry=vt->array[idx];
if(rentry!=NULL){
- struct garbagelist * gl= (struct garbagelist *)&(((SESEcommon*)(rentry->seseRec))[1]);
- updateAscendantSESE(gl);
+ SESEcommon* seseRec = (SESEcommon*)(rentry->seseRec);
+ struct garbagelist * gl= (struct garbagelist *)&(seseRec[1]);
+ updateAscendantSESE(seseRec);
while(gl!=NULL) {
int i;
for(i=0; i<gl->size; i++) {
SCC *scc=(SCC*)memoryItem;
REntry *rentry=scc->val;
if(rentry!=NULL){
- struct garbagelist * gl= (struct garbagelist *)&(((SESEcommon*)(rentry->seseRec))[1]);
- updateAscendantSESE(gl);
+ SESEcommon* seseRec = (SESEcommon*)(rentry->seseRec);
+ struct garbagelist * gl= (struct garbagelist *)&(seseRec[1]);
+ updateAscendantSESE(seseRec);
while(gl!=NULL) {
int i;
for(i=0; i<gl->size; i++) {
}
}
-updateAscendantSESE(struct garbagelist *gl){
- int offsetsize=*((int*)((void*)gl-sizeof(int)));
- int prevSESECount=*((int*)((void*)gl+offsetsize));
- INTPTR tailaddr=(INTPTR)((void*)gl+offsetsize+sizeof(int));
+ updateAscendantSESE(SESEcommon* seseRec){
int prevIdx;
- for(prevIdx=0; prevIdx<prevSESECount; prevIdx++){
- SESEcommon* prevSESE=(SESEcommon*)*((INTPTR*)(tailaddr+sizeof(void*)*prevIdx));
+ for(prevIdx=0; prevIdx<(seseRec->numDependentSESErecords); prevIdx++){
+ SESEcommon* prevSESE = (SESEcommon*)
+ (
+ ((INTPTR)seseRec) +
+ seseRec->offsetToDepSESErecords +
+ (sizeof(INTPTR)*prevIdx)
+ );
+
if(prevSESE!=NULL){
struct garbagelist * prevgl=(struct garbagelist *)&(((SESEcommon*)(prevSESE))[1]);
while(prevgl!=NULL) {
}
}
}
-}
+
+ }
#endif
int within(void *ptr){ //debug function