mirror of
git://git.sv.gnu.org/emacs.git
synced 2026-01-13 23:10:26 -08:00
Remove old collection control
Copied from Perforce Change: 21777 ServerID: perforce.ravenbrook.com
This commit is contained in:
parent
ae295eeaca
commit
b2b52d27d0
1 changed files with 5 additions and 84 deletions
|
|
@ -1,6 +1,6 @@
|
|||
/* impl.c.vmw3: VIRTUAL MEMORY MAPPING FOR WIN32
|
||||
*
|
||||
* $HopeName: MMsrc!vmw3.c(trunk.33) $
|
||||
* $HopeName: MMsrc!vmw3.c(trunk.34) $
|
||||
* Copyright (C) 2000 Harlequin Limited. All rights reserved.
|
||||
*
|
||||
* .design: See design.mps.vm.
|
||||
|
|
@ -55,7 +55,7 @@
|
|||
|
||||
#include "mpswin.h"
|
||||
|
||||
SRCID(vmw3, "$HopeName: MMsrc!vmw3.c(trunk.33) $");
|
||||
SRCID(vmw3, "$HopeName: MMsrc!vmw3.c(trunk.34) $");
|
||||
|
||||
|
||||
/* VMStruct -- virtual memory structure */
|
||||
|
|
@ -94,80 +94,6 @@ Bool VMCheck(VM vm)
|
|||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/* VMRAMSize -- determine the RAM size for the platform
|
||||
*
|
||||
* This is not a protocol function - but it could be in future.
|
||||
*/
|
||||
|
||||
static Res VMRAMSize(VM vm, Size *vmRAMSizeReturn)
|
||||
{
|
||||
MEMORYSTATUS memstat;
|
||||
|
||||
AVERT(VM, vm);
|
||||
|
||||
memstat.dwLength = sizeof(MEMORYSTATUS);
|
||||
GlobalMemoryStatus(&memstat);
|
||||
*vmRAMSizeReturn = (Size)memstat.dwTotalPhys;
|
||||
return ResOK;
|
||||
}
|
||||
|
||||
|
||||
/* VMSetCollectionStrategy -- initialize strategy for platform
|
||||
*
|
||||
* This is not a protocol function - but it could be in future.
|
||||
*/
|
||||
|
||||
static Bool collectionStrategyInited = FALSE;
|
||||
|
||||
static Res VMSetCollectionStrategy(VM vm)
|
||||
{
|
||||
Res res;
|
||||
Size vmRAMSize;
|
||||
|
||||
AVERT(VM, vm);
|
||||
|
||||
/* Avoid resetting the strategy afterwards. Should really have locking */
|
||||
/* but frequencies are not critical, and this will soon be rewritten. @@@@ */
|
||||
if (collectionStrategyInited)
|
||||
return ResOK;
|
||||
collectionStrategyInited = TRUE;
|
||||
|
||||
res = VMRAMSize(vm, &vmRAMSize);
|
||||
|
||||
/* Adjust the collection frequencies according to the RAM size. */
|
||||
/* Note that the RAM size returned is actually slightly less */
|
||||
/* than the total RAM size (for some reason) - so there needs to */
|
||||
/* be a comparison against a lower value than the optimal size. */
|
||||
if (res == ResOK) {
|
||||
if (vmRAMSize >= 110*1024*1024) {
|
||||
TraceGen0Size = 6000uL;
|
||||
TraceGen1Size = 8000uL;
|
||||
TraceGen2Size = 16000uL;
|
||||
TraceGen0RampmodeSize = 12000uL;
|
||||
TraceGen1RampmodeSize = 16000uL;
|
||||
TraceRampGenSize = 32000uL;
|
||||
} else if (vmRAMSize >= 60*1024*1024) {
|
||||
TraceGen0Size = 6000uL;
|
||||
TraceGen1Size = 8000uL;
|
||||
TraceGen2Size = 13000uL;
|
||||
TraceGen0RampmodeSize = 6000uL;
|
||||
TraceGen1RampmodeSize = 9000uL;
|
||||
TraceRampGenSize = 18000uL;
|
||||
} else {
|
||||
TraceGen0Size = 4000uL;
|
||||
TraceGen1Size = 3300uL;
|
||||
TraceGen2Size = 8000uL;
|
||||
TraceGen0RampmodeSize = 4000uL;
|
||||
TraceGen1RampmodeSize = 4300uL;
|
||||
TraceRampGenSize = 13300uL;
|
||||
}
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
|
||||
/* VMCreate -- reserve some virtual address space, and create a VM structure */
|
||||
|
||||
Res VMCreate(VM *vmReturn, Size size)
|
||||
|
|
@ -218,9 +144,6 @@ Res VMCreate(VM *vmReturn, Size size)
|
|||
vm->sig = VMSig;
|
||||
AVERT(VM, vm);
|
||||
|
||||
res = VMSetCollectionStrategy(vm);
|
||||
AVER(res == ResOK);
|
||||
|
||||
EVENT_PAA(VMCreate, vm, vm->base, vm->limit);
|
||||
*vmReturn = vm;
|
||||
return ResOK;
|
||||
|
|
@ -341,11 +264,9 @@ void VMUnmap(VM vm, Addr base, Addr limit)
|
|||
AVER(base < limit);
|
||||
AVER(limit <= vm->limit);
|
||||
|
||||
/* .improve.query-unmap: Could check that the pages we are about
|
||||
* to unmap are mapped, using VirtualQuery.
|
||||
*/
|
||||
b = VirtualFree((LPVOID)base, (DWORD)AddrOffset(base, limit),
|
||||
MEM_DECOMMIT);
|
||||
/* .improve.query-unmap: Could check that the pages we are about */
|
||||
/* to unmap are mapped, using VirtualQuery. */
|
||||
b = VirtualFree((LPVOID)base, (DWORD)AddrOffset(base, limit), MEM_DECOMMIT);
|
||||
AVER(b != 0); /* .assume.free.success */
|
||||
vm->mapped -= AddrOffset(base, limit);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue