1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2026-04-24 23:31:33 -07:00

Try later allocation plans if growing the arena fails.

Copied from Perforce
 Change: 189363
 ServerID: perforce.ravenbrook.com
This commit is contained in:
Richard Brooksby 2016-02-26 19:06:07 +00:00
parent 5fc8accc63
commit 6aec944f87

View file

@ -85,19 +85,21 @@ Res PolicyAlloc(Tract *tractReturn, Arena arena, LocusPref pref,
if (arena->class->purgeSpare(arena, size) >= size)
res = arena->class->grow(arena, pref, size);
}
if (res != ResOK)
return res;
if (zones != ZoneSetEMPTY) {
res = ArenaFreeLandAlloc(&tract, arena, zones, pref->high, size, pool);
if (res == ResOK)
goto found;
}
if (moreZones != zones) {
res = ArenaFreeLandAlloc(&tract, arena, moreZones, pref->high,
size, pool);
if (res == ResOK)
goto found;
if (res == ResOK) {
if (zones != ZoneSetEMPTY) {
res = ArenaFreeLandAlloc(&tract, arena, zones, pref->high, size, pool);
if (res == ResOK)
goto found;
}
if (moreZones != zones) {
res = ArenaFreeLandAlloc(&tract, arena, moreZones, pref->high,
size, pool);
if (res == ResOK)
goto found;
}
}
/* TODO: Log an event here, since something went wrong, before
trying the next plan anyway. */
}
/* Plan D: add every zone that isn't blacklisted. This might mix GC'd