Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Bug#245678: zsh: built-in rm -rf fills up the memory
- X-seq: zsh-workers 19896
- From: Clint Adams <clint@xxxxxxx>
- To: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- Subject: Re: Bug#245678: zsh: built-in rm -rf fills up the memory
- Date: Sat, 8 May 2004 10:13:07 -0400
- Cc: 245678-submitter@xxxxxxxxxxxxxxx, zsh-workers@xxxxxxxxxx
- In-reply-to: <20040508140207.GA25045@xxxxxxxxxxx>
- Mailing-list: contact zsh-workers-help@xxxxxxxxxx; run by ezmlm
- References: <20040424162150.GA4210@xxxxxxxxxxxxx> <20040425013647.GA28395@xxxxxxxxxxx> <1040425204530.ZM25792@xxxxxxxxxxxxxxxxxxxxxxx> <20040425211239.GA5011@xxxxxxxxxxx> <1040426171013.ZM26825@xxxxxxxxxxxxxxxxxxxxxxx> <20040508043530.GA21396@xxxxxxxxxxx> <20040508140207.GA25045@xxxxxxxxxxx>
> Now, should this be fixed by making hrealloc() smarter or
> recursivecmd_dorec() more efficient?
Here's one non-portable way of preventing the OOM, and making the rm -rf
go quickly.
Should H_ISIZE be changed to the page size when USE_MMAP is defined, or
is there a reason to keep it the sizeof(union mem_align) ?
--- orig/Src/mem.c
+++ mod/Src/mem.c
@@ -379,8 +379,8 @@
{
Heap h, ph;
- old = (old + H_ISIZE - 1) & ~(H_ISIZE - 1);
- new = (new + H_ISIZE - 1) & ~(H_ISIZE - 1);
+ old = (old + 4096 - 1) & ~(4096 - 1);
+ new = (new + 4096 - 1) & ~(4096 - 1);
if (old == new)
return p;
Messages sorted by:
Reverse Date,
Date,
Thread,
Author