From 44a94779a85f2a87cd0d552c1d272b8c05b85630 Mon Sep 17 00:00:00 2001 From: Herbert Xu Date: Sun, 11 Nov 2007 15:00:06 +0800 Subject: [EXPAND] Removed herefd hack The herefd hack goes back more than a decade. it limits the amount of memory we have to allocate when expanding here-documents by writing the result out from time to time. However, it's no longer safe because the stack is used to place intermediate results too and there we certainly don't want to write them out should we be short on memory. In any case, with today's computers we can afford to keep the entire result in memory and write them out at the end. --- src/memalloc.c | 5 ----- 1 file changed, 5 deletions(-) (limited to 'src/memalloc.c') diff --git a/src/memalloc.c b/src/memalloc.c index 8d3e2ed..e75e609 100644 --- a/src/memalloc.c +++ b/src/memalloc.c @@ -109,7 +109,6 @@ struct stack_block *stackp = &stackbase; char *stacknxt = stackbase.space; size_t stacknleft = MINSIZE; char *sstrend = stackbase.space + MINSIZE; -int herefd = -1; pointer stalloc(size_t nbytes) @@ -264,10 +263,6 @@ void * growstackstr(void) { size_t len = stackblocksize(); - if (herefd >= 0 && len >= 1024) { - xwrite(herefd, stackblock(), len); - return stackblock(); - } growstackblock(); return stackblock() + len; } -- cgit 1.4.1