1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2026-01-04 11:00:45 -08:00

Refactored implementation of preferenced allocation policy from vm arena to general purpose arena.

Eliminating SegPrefExpress in most places, especially where there wasn’t really any preference.
Eliminating special case knowledge about garbage collection from the arena.

Copied from Perforce
 Change: 184279
 ServerID: perforce.ravenbrook.com
This commit is contained in:
Richard Brooksby 2014-01-30 18:08:10 +00:00
parent d3978def6a
commit 7a73e98638
10 changed files with 151 additions and 43 deletions

View file

@ -25,7 +25,7 @@ Bool SegPrefCheck(SegPref pref)
CHECKS(SegPref, pref);
CHECKL(BoolCheck(pref->high));
/* zones can't be checked because it's arbitrary. */
CHECKL(BoolCheck(pref->isCollected));
/* avoid can't be checked because it's arbitrary. */
return TRUE;
}
@ -70,11 +70,6 @@ void SegPrefExpress(SegPref pref, SegPrefKind kind, void *p)
pref->zones = *(ZoneSet *)p;
break;
case SegPrefCollected:
AVER(p == NULL);
pref->isCollected = TRUE;
break;
default:
/* Unknown kinds are ignored for binary compatibility. */
/* See design.mps.pref. */
@ -261,8 +256,8 @@ Res ChainAlloc(Seg *segReturn, Chain chain, Serial genNr, SegClass class,
zones = arena->topGen.zones;
SegPrefInit(&pref);
SegPrefExpress(&pref, SegPrefCollected, NULL);
SegPrefExpress(&pref, SegPrefZoneSet, &zones);
pref.zones = zones;
pref.avoid = ZoneSetBlacklist(arena);
res = SegAlloc(&seg, class, &pref, size, pool, withReservoirPermit, args);
if (res != ResOK)
return res;