From a39cc60c52310e0acf5e973b4fa99c7c014874d5 Mon Sep 17 00:00:00 2001 From: cinap_lenrek Date: Fri, 10 Apr 2020 22:25:29 +0200 Subject: [PATCH] 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. --- sys/src/cmd/cc/macbody | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/sys/src/cmd/cc/macbody b/sys/src/cmd/cc/macbody index b6cf60e78..7d837fb43 100644 --- a/sys/src/cmd/cc/macbody +++ b/sys/src/cmd/cc/macbody @@ -854,16 +854,9 @@ gethunk(void) char *h; long nh; - 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 = NHUNK; + if(thunk >= 10L*NHUNK) nh = 10L*NHUNK; - else - nh = NHUNK; h = (char*)mysbrk(nh); if(h == (char*)-1) { yyerror("out of memory");