1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2026-01-07 12:20:39 -08:00

Fix the levels computation.

Copied from Perforce
 Change: 184612
 ServerID: perforce.ravenbrook.com
This commit is contained in:
Gareth Rees 2014-02-28 19:31:33 +00:00
parent 90d9df5c00
commit c213b085e0

View file

@ -85,9 +85,9 @@ Res NailboardCreate(Nailboard *boardReturn, Arena arena, Align alignment,
AVER(AddrIsAligned(limit, alignment));
nails = AddrOffset(base, limit) / alignment;
levels = SizeRoundUp(SizeLog2(nails), levelShift) / levelShift;
levels = SizeRoundUp(SizeLog2(nails) + 1, levelShift) / levelShift;
AVER((nails >> ((levels - 1) * levelShift)) > 0);
AVER((nails >> (levels * levelShift)) <= 1);
AVER((nails >> (levels * levelShift)) == 0);
structSize = nailboardStructSize(levels);
levelsSize = nailboardLevelsSize(nails, levels, levelShift);