#ifndef NORCSID static char rcsid[] = "$Id$"; #endif #include #include #include #include "param.h" #include "tables.h" #include "types.h" #include #include "data.h" #include "result.h" #include "extern.h" /* * (c) copyright 1987 by the Vrije Universiteit, Amsterdam, The Netherlands. * See the copyright notice in the ACK home directory, in the file "Copyright". * * Author: Hans van Staveren */ /* * Package for string allocation and garbage collection. * Call salloc(size) to get room for string. * Every now and then call garbage_collect() from toplevel. */ #define MAXSTAB 1500 #define THRESHOLD 200 char *stab[MAXSTAB]; int nstab=0; static void chkstr(string, char *); string myalloc(int size) { string p; p = (string) calloc((unsigned)size, 1); if (p==0) fatal("Out of memory"); return(p); } void myfree(string p) { free(p); } void popstr(int nnstab) { int i; for (i=nnstab;iem_soper,used); for (tp= fakestack;tp<&fakestack[stackheight];tp++) { if (tp->t_token== -1) continue; tdp = &tokens[tp->t_token]; for (i=0;it_type[i] == EV_ADDR) chkstr(tp->t_att[i].aa.ea_str,used); } for (rp= machregs+1; rpr_contents; assert(tp->t_token != -1); tdp= &tokens[tp->t_token]; for (i=0;it_type[i] == EV_ADDR) chkstr(tp->t_att[i].aa.ea_str,used); } for (i=0;ilow) { middle= (low+high)>>1; if (str==stab[middle]) { used[middle]=1; return; } if (str