mirror of
https://github.com/ApfelTeeSaft/reactos.git
synced 2026-08-30 19:26:05 +00:00
- Fix for lengthy delays when freeing a memory area. Don't attach/detach
another process when deleting each page table entry. svn path=/trunk/; revision=5211
This commit is contained in:
@@ -367,6 +367,7 @@ MmFreeMemoryArea(PMADDRESS_SPACE AddressSpace,
|
||||
{
|
||||
MEMORY_AREA* MemoryArea;
|
||||
ULONG i;
|
||||
PEPROCESS CurrentProcess = PsGetCurrentProcess();
|
||||
|
||||
DPRINT("MmFreeMemoryArea(AddressSpace %x, BaseAddress %x, Length %x,"
|
||||
"FreePageContext %d)\n",AddressSpace,BaseAddress,Length,
|
||||
@@ -379,6 +380,11 @@ MmFreeMemoryArea(PMADDRESS_SPACE AddressSpace,
|
||||
KeBugCheck(0);
|
||||
return(STATUS_UNSUCCESSFUL);
|
||||
}
|
||||
if (AddressSpace->Process != NULL &&
|
||||
AddressSpace->Process != CurrentProcess)
|
||||
{
|
||||
KeAttachProcess(AddressSpace->Process);
|
||||
}
|
||||
for (i=0; i<(PAGE_ROUND_UP(MemoryArea->Length)/PAGE_SIZE); i++)
|
||||
{
|
||||
PHYSICAL_ADDRESS PhysAddr = (PHYSICAL_ADDRESS)0LL;
|
||||
@@ -406,7 +412,11 @@ MmFreeMemoryArea(PMADDRESS_SPACE AddressSpace,
|
||||
SwapEntry, Dirty);
|
||||
}
|
||||
}
|
||||
|
||||
if (AddressSpace->Process != NULL &&
|
||||
AddressSpace->Process != CurrentProcess)
|
||||
{
|
||||
KeDetachProcess();
|
||||
}
|
||||
RemoveEntryList(&MemoryArea->Entry);
|
||||
ExFreePool(MemoryArea);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user