cc: backout gethunk() change

the real problem is that gethunk() does not grow the allocation
but just allocates a new hunk, so repeated calls to gethunk()
wont make nhunk grow to satisfy the allocation.

this will be fixed in a upcoming commit.
This commit is contained in:
cinap_lenrek 2020-04-10 22:25:29 +02:00
parent 6018316eef
commit a39cc60c52

View file

@ -854,16 +854,9 @@ gethunk(void)
char *h; char *h;
long nh; long nh;
if(thunk >= 100L*NHUNK) nh = NHUNK;
nh = 100L*NHUNK; if(thunk >= 10L*NHUNK)
else if(thunk >= 50L*NHUNK)
nh = 50L*NHUNK;
else if(thunk >= 25L*NHUNK)
nh = 25L*NHUNK;
else if(thunk >= 10L*NHUNK)
nh = 10L*NHUNK; nh = 10L*NHUNK;
else
nh = NHUNK;
h = (char*)mysbrk(nh); h = (char*)mysbrk(nh);
if(h == (char*)-1) { if(h == (char*)-1) {
yyerror("out of memory"); yyerror("out of memory");