1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2026-03-15 11:21:19 -07:00

Merging from brisling, arenasetcommitlimit shoudl flush if that would help, change.epcore.chub.160132 ass 2

Copied from Perforce
 Change: 20572
 ServerID: perforce.ravenbrook.com
This commit is contained in:
David Jones 1999-02-18 12:15:33 +00:00
parent 2654d99e64
commit ff96fb39f8

View file

@ -1,6 +1,6 @@
/* impl.c.arena: ARENA IMPLEMENTATION
*
* $HopeName: MMsrc!arena.c(trunk.62) $
* $HopeName: MMsrc!arena.c(trunk.63) $
* Copyright (C) 1998. Harlequin Group plc. All rights reserved.
*
* .readership: Any MPS developer
@ -36,7 +36,7 @@
#include "poolmrg.h"
#include "mps.h"
SRCID(arena, "$HopeName: MMsrc!arena.c(trunk.62) $");
SRCID(arena, "$HopeName: MMsrc!arena.c(trunk.63) $");
/* Forward declarations */
@ -1426,12 +1426,21 @@ Size ArenaCommitLimit(Arena arena)
Res ArenaSetCommitLimit(Arena arena, Size limit)
{
Size committed;
AVERT(Arena, arena);
AVER(ArenaCommitted(arena) <= arena->commitLimit);
if(limit < ArenaCommitted(arena)) {
committed = ArenaCommitted(arena);
if(limit < committed) {
/* Attempt to set the limit below current committed */
return ResFAIL;
if (limit >= committed - arena->spareCommitted) {
/* could set the limit by flushing any spare committed memory */
arena->class->spareCommitExceeded(arena);
AVER(limit >= ArenaCommitted(arena));
} else {
return ResFAIL;
}
}
arena->commitLimit = limit;
return ResOK;