diff options
author | Sigrid <ftrvxmtrx@gmail.com> | 2020-04-10 17:19:44 +0200 |
---|---|---|
committer | Sigrid <ftrvxmtrx@gmail.com> | 2020-04-10 17:19:44 +0200 |
commit | 6018316eef179f421ee2b31ec76a9f3638e9bc15 (patch) | |
tree | ac99632f52b0f32332ec027104f26f0e22c55a2e | |
parent | 1fe3143e4c43ce2c74e0cfdd70b1bd556bbb9e1b (diff) |
cc: sbrk in bigger chunks as it grows, so it gets a chance to use the ram/swap available
-rw-r--r-- | sys/src/cmd/cc/macbody | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/sys/src/cmd/cc/macbody b/sys/src/cmd/cc/macbody index 7d837fb43..b6cf60e78 100644 --- a/sys/src/cmd/cc/macbody +++ b/sys/src/cmd/cc/macbody @@ -854,9 +854,16 @@ gethunk(void) char *h; long nh; - nh = NHUNK; - if(thunk >= 10L*NHUNK) + if(thunk >= 100L*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; + else + nh = NHUNK; h = (char*)mysbrk(nh); if(h == (char*)-1) { yyerror("out of memory"); |