mirror of
git://git.sv.gnu.org/emacs.git
synced 2025-12-31 01:20:37 -08:00
Purge spare committed memory when growing the arena fails due to the commit limit.
Copied from Perforce Change: 189362 ServerID: perforce.ravenbrook.com
This commit is contained in:
parent
c47a41d163
commit
ef17ba047b
1 changed files with 8 additions and 0 deletions
|
|
@ -77,6 +77,14 @@ Res PolicyAlloc(Tract *tractReturn, Arena arena, LocusPref pref,
|
|||
/* Plan C: Extend the arena, then try A and B again. */
|
||||
if (moreZones != ZoneSetEMPTY) {
|
||||
res = arena->class->grow(arena, pref, size);
|
||||
/* If we can't extent because we hit the commit limit, try purging
|
||||
some spare committed memory and try again.*/
|
||||
/* TODO: This would be a good time to *remap* VM instead of
|
||||
returning it to the OS. */
|
||||
if (res == ResCOMMIT_LIMIT) {
|
||||
if (arena->class->purgeSpare(arena, size) >= size)
|
||||
res = arena->class->grow(arena, pref, size);
|
||||
}
|
||||
if (res != ResOK)
|
||||
return res;
|
||||
if (zones != ZoneSetEMPTY) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue