void PurgeSymbols( void ) /******************************/ { symbol ** list; symbol * sym; WalkHashTables( PurgeHashTable ); WalkHashTables( CleanupOldAltdefs ); list = &HeadSym; while( *list != NULL ) { sym = *list; if( sym->info & SYM_KILL ) { *list = sym->link; FreeSymbol( sym ); } else if( sym->info & SYM_IS_ALTDEF ) { *list = sym->link; // gonna get rid of these later } else { if( IS_SYM_ALIAS(sym) && sym->info & SYM_WAS_LAZY ) { WipeSym( sym ); sym->info = SYM_WEAK_REF | SYM_REFERENCED; } LastSym = sym; list = &(*list)->link; } } }
void CgBackFreeIndCalls( // FREE ALL INDIRECT-CALL SYMBOLS void ) { SYMBOL curr; // - current symbol SYMBOL next; // - next symbol for( curr = ind_call_free; curr != NULL; curr = next ) { next = curr->thread; FreeSymbol( curr ); } ind_call_free = NULL; }
// currently a no-op void FreeTag(TagPtr tag) { return; // XXXX revisit callers, particularly ParseTagKey (4063982) if (tag == 0) return; if (tag->string) FreeSymbol(tag->string); FreeTag(tag->tag); FreeTag(tag->tagNext); // Clear and free the tag. tag->type = kTagTypeNone; tag->string = 0; tag->tag = 0; tag->tagNext = gTagsFree; gTagsFree = tag; }
void CleanSym( void ) /*************************/ { symbol * sym; symbol * next; #ifdef _INT_DEBUG DumpHashTable(); #endif if( !(LinkFlags & INC_LINK_FLAG) ) { for( sym = HeadSym; sym != NULL; sym = next ) { next = sym->link; FreeSymbol( sym ); } } RelSymBlock(); ReleasePass1(); }
void FreeTag( TagPtr tag ) { if (tag == NULL) return; if (tag->string) FreeSymbol(tag->string); FreeTag(tag->tag); FreeTag(tag->tagNext); // Clear and free the tag. tag->type = kTagTypeNone; tag->string = NULL; tag->tag = NULL; tag->offset = 0; tag->tagNext = gTagsFree; gTagsFree = tag; }
SYMBOL * StoreSymbol(SYMBOL *NewSym,char *string) { SYMBOL *Sym = FreeSymbol(); char *ThisName; // Location of PTR to name int StringLen; int entry; StringLen = strlen(string) + 1; // Get length of string // if there was not Symbol space quit if (Sym == NULL) return NULL; // if there was no name space quit ThisName = (char *) NewPtr((int) StringLen); // Copy the name to the NamesList memcpy(ThisName,string,StringLen); memcpy(Sym,NewSym,sizeof(SYMBOL)); // Set the Symbol data ptr Sym->Name = ThisName; Sym->Len = StringLen-1; Sym->Flags = 0; // Add symbol to hash table #ifdef USE_HASHING entry = HashSymbol(Sym->Name, Sym->LocalScope, Sym->Section); BucketArrayAdd(&SymbolHash, entry, (int) Sym); #endif // Carry forward the names pointer return Sym; }
void XMLFreeTag( TagPtr tag ) { #if DOFREE if (tag == 0) return; if (tag->string) FreeSymbol(tag->string); XMLFreeTag(tag->tag); XMLFreeTag(tag->tagNext); // Clear and free the tag. tag->type = kTagTypeNone; tag->string = 0; tag->tag = 0; tag->tagNext = gTagsFree; gTagsFree = tag; #else return; #endif }
void CgBackFreeIndCall( // FREE INDIRECT-CALL SYMBOL SYMBOL sym ) // - symbol to be freed { #if 1 sym = sym; #else SYMBOL curr; // - current symbol in free list SYMBOL prev; // - previous symbol for( prev = NULL, curr = ind_call_free ; curr != sym ; prev = curr, curr = curr->thread ) { DbgVerify( curr != NULL, "CgBackFreeIndCall: can't find symbol" ); } curr = curr->thread; if( prev == NULL ) { ind_call_free = curr; } else { prev->thread = curr; } FreeSymbol( sym ); #endif }