backout the gethunk() again, as that breaks the assemblers
the assemblers share gethunk() cc/macbody but are compiled without compat.c, so calls such as getenv() trigger malloc() which does its own sbrk() calls, breaking the continuity of the hunk. so this change needs another revision. until then, this is backed out.
This commit is contained in:
parent
1d3644a168
commit
9d46360c9d
|
@ -1099,11 +1099,8 @@ gethunk(void)
|
|||
diag("out of memory");
|
||||
errorexit();
|
||||
}
|
||||
if(nhunk == 0)
|
||||
hunk = h;
|
||||
else
|
||||
nh += (h - hunk) - nhunk;
|
||||
nhunk += nh;
|
||||
hunk = h;
|
||||
nhunk = nh;
|
||||
thunk += nh;
|
||||
}
|
||||
|
||||
|
|
|
@ -1121,11 +1121,8 @@ gethunk(void)
|
|||
diag("out of memory");
|
||||
errorexit();
|
||||
}
|
||||
if(nhunk == 0)
|
||||
hunk = h;
|
||||
else
|
||||
nh += (h - hunk) - nhunk;
|
||||
nhunk += nh;
|
||||
hunk = h;
|
||||
nhunk = nh;
|
||||
thunk += nh;
|
||||
}
|
||||
|
||||
|
|
|
@ -1152,11 +1152,8 @@ gethunk(void)
|
|||
diag("out of memory");
|
||||
errorexit();
|
||||
}
|
||||
if(nhunk == 0)
|
||||
hunk = h;
|
||||
else
|
||||
nh += (h - hunk) - nhunk;
|
||||
nhunk += nh;
|
||||
hunk = h;
|
||||
nhunk = nh;
|
||||
thunk += nh;
|
||||
}
|
||||
|
||||
|
|
|
@ -1222,11 +1222,8 @@ gethunk(void)
|
|||
diag("out of memory");
|
||||
errorexit();
|
||||
}
|
||||
if(nhunk == 0)
|
||||
hunk = h;
|
||||
else
|
||||
nh += (h - hunk) - nhunk;
|
||||
nhunk += nh;
|
||||
hunk = h;
|
||||
nhunk = nh;
|
||||
thunk += nh;
|
||||
}
|
||||
|
||||
|
|
|
@ -1178,11 +1178,8 @@ gethunk(void)
|
|||
diag("out of memory");
|
||||
errorexit();
|
||||
}
|
||||
if(nhunk == 0)
|
||||
hunk = h;
|
||||
else
|
||||
nh += (h - hunk) - nhunk;
|
||||
nhunk += nh;
|
||||
hunk = h;
|
||||
nhunk = nh;
|
||||
thunk += nh;
|
||||
}
|
||||
|
||||
|
|
|
@ -1196,11 +1196,8 @@ gethunk(void)
|
|||
diag("out of memory");
|
||||
errorexit();
|
||||
}
|
||||
if(nhunk == 0)
|
||||
hunk = h;
|
||||
else
|
||||
nh += (h - hunk) - nhunk;
|
||||
nhunk += nh;
|
||||
hunk = h;
|
||||
nhunk = nh;
|
||||
thunk += nh;
|
||||
}
|
||||
|
||||
|
|
|
@ -862,10 +862,7 @@ gethunk(void)
|
|||
yyerror("out of memory");
|
||||
errorexit();
|
||||
}
|
||||
if(nhunk == 0)
|
||||
hunk = h;
|
||||
else
|
||||
nh += (h - hunk) - nhunk;
|
||||
nhunk += nh;
|
||||
hunk = h;
|
||||
nhunk = nh;
|
||||
thunk += nh;
|
||||
}
|
||||
|
|
|
@ -241,7 +241,7 @@ EXTERN long symsize;
|
|||
EXTERN long staticgen;
|
||||
EXTERN Prog* textp;
|
||||
EXTERN long textsize;
|
||||
EXTERN uintptr thunk;
|
||||
EXTERN uintptr tothunk;
|
||||
EXTERN char xcmp[C_NCLASS][C_NCLASS];
|
||||
EXTERN int version;
|
||||
EXTERN Prog zprg;
|
||||
|
|
|
@ -194,7 +194,7 @@ main(int argc, char *argv[])
|
|||
out:
|
||||
if(debug['v']) {
|
||||
Bprint(&bso, "%5.2f cpu time\n", cputime());
|
||||
Bprint(&bso, "%zud memory used\n", thunk);
|
||||
Bprint(&bso, "%zud memory used\n", tothunk);
|
||||
Bprint(&bso, "%d sizeof adr\n", sizeof(Adr));
|
||||
Bprint(&bso, "%d sizeof prog\n", sizeof(Prog));
|
||||
}
|
||||
|
@ -983,9 +983,9 @@ gethunk(void)
|
|||
long nh;
|
||||
|
||||
nh = NHUNK;
|
||||
if(thunk >= 5L*NHUNK) {
|
||||
if(tothunk >= 5L*NHUNK) {
|
||||
nh = 5L*NHUNK;
|
||||
if(thunk >= 25L*NHUNK)
|
||||
if(tothunk >= 25L*NHUNK)
|
||||
nh = 25L*NHUNK;
|
||||
}
|
||||
h = mysbrk(nh);
|
||||
|
@ -993,12 +993,10 @@ gethunk(void)
|
|||
diag("out of memory");
|
||||
errorexit();
|
||||
}
|
||||
if(nhunk == 0)
|
||||
hunk = h;
|
||||
else
|
||||
nh += (h - hunk) - nhunk;
|
||||
nhunk += nh;
|
||||
thunk += nh;
|
||||
|
||||
hunk = h;
|
||||
nhunk = nh;
|
||||
tothunk += nh;
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
@ -234,7 +234,7 @@ EXTERN long symsize;
|
|||
EXTERN long staticgen;
|
||||
EXTERN Prog* textp;
|
||||
EXTERN long textsize;
|
||||
EXTERN uintptr thunk;
|
||||
EXTERN uintptr tothunk;
|
||||
EXTERN char xcmp[C_NCLASS][C_NCLASS];
|
||||
EXTERN int version;
|
||||
EXTERN Prog zprg;
|
||||
|
|
|
@ -273,7 +273,7 @@ main(int argc, char *argv[])
|
|||
out:
|
||||
if(debug['v']) {
|
||||
Bprint(&bso, "%5.2f cpu time\n", cputime());
|
||||
Bprint(&bso, "%zud memory used\n", thunk);
|
||||
Bprint(&bso, "%zud memory used\n", tothunk);
|
||||
Bprint(&bso, "%d sizeof adr\n", sizeof(Adr));
|
||||
Bprint(&bso, "%d sizeof prog\n", sizeof(Prog));
|
||||
}
|
||||
|
@ -1117,9 +1117,9 @@ gethunk(void)
|
|||
long nh;
|
||||
|
||||
nh = NHUNK;
|
||||
if(thunk >= 5L*NHUNK) {
|
||||
if(tothunk >= 5L*NHUNK) {
|
||||
nh = 5L*NHUNK;
|
||||
if(thunk >= 25L*NHUNK)
|
||||
if(tothunk >= 25L*NHUNK)
|
||||
nh = 25L*NHUNK;
|
||||
}
|
||||
h = mysbrk(nh);
|
||||
|
@ -1127,12 +1127,10 @@ gethunk(void)
|
|||
diag("out of memory");
|
||||
errorexit();
|
||||
}
|
||||
if(nhunk == 0)
|
||||
hunk = h;
|
||||
else
|
||||
nh += (h - hunk) - nhunk;
|
||||
nhunk += nh;
|
||||
thunk += nh;
|
||||
|
||||
hunk = h;
|
||||
nhunk = nh;
|
||||
tothunk += nh;
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
@ -1075,11 +1075,8 @@ gethunk(void)
|
|||
diag("out of memory");
|
||||
errorexit();
|
||||
}
|
||||
if(nhunk == 0)
|
||||
hunk = h;
|
||||
else
|
||||
nh += (h - hunk) - nhunk;
|
||||
nhunk += nh;
|
||||
hunk = h;
|
||||
nhunk = nh;
|
||||
thunk += nh;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue