mirror of
https://github.com/reactos/reactos.git
synced 2024-08-07 19:58:21 +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:
parent
a3cf0cbc62
commit
b9185cc4c4
|
@ -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);
|
||||
|
||||
|
|
Loading…
Reference in a new issue