cc: sbrk in bigger chunks as it grows, so it gets a chance to use the ram/swap available
This commit is contained in:
parent
1fe3143e4c
commit
6018316eef
1 changed files with 9 additions and 2 deletions
|
@ -854,9 +854,16 @@ gethunk(void)
|
||||||
char *h;
|
char *h;
|
||||||
long nh;
|
long nh;
|
||||||
|
|
||||||
nh = NHUNK;
|
if(thunk >= 100L*NHUNK)
|
||||||
if(thunk >= 10L*NHUNK)
|
nh = 100L*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");
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue