mirror of git://git.code.sf.net/p/zsh/code
36943: restore scan for reclaimable blocks in freeheap()
That scan had been removed by 36834, but testing showed memory usage climbing too high in cases where a new arena was always added at the end of the heap list.
This commit is contained in:
parent
272119b774
commit
506d592380
|
@ -1,3 +1,8 @@
|
|||
2015-10-24 Barton E. Schaefer <schaefer@zsh.org>
|
||||
|
||||
* 36943 (with updated comment): Src/mem.c: restore scan for
|
||||
reclaimable blocks in freeheap() [had been removed by 36834]
|
||||
|
||||
2015-10-24 Peter Stephenson <p.w.stephenson@ntlworld.com>
|
||||
|
||||
* unposted: Src/utils.c: small typo.
|
||||
|
|
10
Src/mem.c
10
Src/mem.c
|
@ -340,9 +340,15 @@ freeheap(void)
|
|||
* and performance goes to hell.
|
||||
*
|
||||
* Therefore, we defer freeing the most recently allocated arena until
|
||||
* we reach popheap(). This may fail to reclaim some space in earlier
|
||||
* arenas.
|
||||
* we reach popheap().
|
||||
*
|
||||
* However, if the arena to which fheap points is unused, we want to
|
||||
* reclaim space in earlier arenas, so we have no choice but to do the
|
||||
* sweep for a new fheap.
|
||||
*/
|
||||
if (fheap && !fheap->sp)
|
||||
fheap = NULL; /* We used to do this unconditionally */
|
||||
/*
|
||||
* In other cases, either fheap is already correct, or it has never
|
||||
* been set and this loop will do it, or it'll be reset from scratch
|
||||
* on the next popheap(). So all that's needed here is to pick up
|
||||
|
|
Loading…
Reference in New Issue