1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2025-12-24 22:40:51 -08:00

Inserting small ranges into the zone cbss so that they can be reallocated quickly.

Copied from Perforce
 Change: 184579
 ServerID: perforce.ravenbrook.com
This commit is contained in:
Richard Brooksby 2014-02-27 17:01:29 +00:00
parent 6b17c88c69
commit dee2b3438b

View file

@ -127,6 +127,8 @@ void ZonedCBSFinish(ZonedCBS zcbs)
Res ZonedCBSInsert(Range rangeReturn, ZonedCBS zcbs, Range range)
{
ZoneSet zs;
AVERT(ZonedCBS, zcbs);
/* TODO: Consider moving empty zone stripes back to freeCBS. At the
@ -136,6 +138,13 @@ Res ZonedCBSInsert(Range rangeReturn, ZonedCBS zcbs, Range range)
eagerly in any case, but lazily if we're unable to find address
space, even though that reduces first-fit. */
zs = ZoneSetOfRange(zcbs->arena, RangeBase(range), RangeLimit(range));
if (ZoneSetIsSingle(zs)) {
Index zone = AddrZone(zcbs->arena, RangeBase(range));
CBS zoneCBS = ZonedCBSZoneCBS(zcbs, zone);
return CBSInsert(rangeReturn, zoneCBS, range);
}
return CBSInsert(rangeReturn, ZonedCBSFreeCBS(zcbs), range);
}