1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2025-12-24 06:20:43 -08:00

Mps br/vmem arenavm.c: (diagnostic variety only) fix floating point exception after a collection with 0 bytes condemned

The VMCompact diag was calculating the live percentage by dividing by condemned size.  Don't do this if condemned is zero.

Copied from Perforce
 Change: 170441
 ServerID: perforce.ravenbrook.com
This commit is contained in:
Richard Kistruck 2010-04-26 16:06:36 +01:00
parent fad9fa8edc
commit ec9fd145fb

View file

@ -1676,8 +1676,11 @@ static void VMCompact(Arena arena, Trace trace)
Size vmem2 = VMArenaReserved(arena);
Size vmemD = vmem1 - vmem2;
Size live = trace->forwardedSize + trace->preservedInPlaceSize;
Size livePerc = live / (trace->condemned / 100);
Size livePerc = 0;
if(trace->condemned / 100 != 0)
livePerc = live / (trace->condemned / 100);
/* VMCompact diag: emit for all client-requested collections, */
/* plus any others where chunks were gained or lost during the */
/* collection. */