mirror of
https://github.com/golang/go
synced 2024-11-25 19:07:57 -07:00
reallocate library, libraryobj: 50 isn't nearly enough
R=rsc DELTA=7 (2 added, 0 deleted, 5 changed) OCL=35569 CL=35569
This commit is contained in:
parent
6e4f935369
commit
86cfaf66a7
@ -153,9 +153,10 @@ addlib(char *src, char *obj)
|
||||
for(i=0; i<libraryp; i++)
|
||||
if(strcmp(name, library[i]) == 0)
|
||||
return;
|
||||
if(libraryp == nelem(library)){
|
||||
diag("too many autolibs; skipping %s", name);
|
||||
return;
|
||||
if(libraryp == nlibrary){
|
||||
nlibrary = 50 + 2*libraryp;
|
||||
library = realloc(library, sizeof library[0] * nlibrary);
|
||||
libraryobj = realloc(libraryobj, sizeof libraryobj[0] * nlibrary);
|
||||
}
|
||||
|
||||
p = mal(strlen(name) + 1);
|
||||
|
@ -36,9 +36,10 @@ extern int cout;
|
||||
EXTERN char* INITENTRY;
|
||||
EXTERN char thechar;
|
||||
EXTERN char* thestring;
|
||||
EXTERN char* library[50];
|
||||
EXTERN char* libraryobj[50];
|
||||
EXTERN char** library;
|
||||
EXTERN char** libraryobj;
|
||||
EXTERN int libraryp;
|
||||
EXTERN int nlibrary;
|
||||
EXTERN Sym* hash[NHASH];
|
||||
EXTERN Sym* histfrog[MAXHIST];
|
||||
EXTERN uchar fnuxi8[8];
|
||||
|
Loading…
Reference in New Issue
Block a user