mirror of
https://github.com/reactos/reactos.git
synced 2024-06-30 18:01:07 +00:00
[FREELDR]: For *every single heap allocation*, there was code to request an entire *heap statistic run*! This is ridiculous and slows heap allocations tremendously. Additionally, it also assumes bstats was linked in, which it might not be if the flag wasn't set in bheap.c. Only enable this code if a special MM_DBG define is set.
[FREELDR]: Done originally for ARM, but I think x86 will appreciate the benefit too (and x86 can now go ahead and disable all those ridiculous debug settings that are turned on by default in bheap.c). svn path=/trunk/; revision=49756
This commit is contained in:
parent
7ca4b3879b
commit
e79eaea9b3
|
@ -85,7 +85,6 @@ PVOID MmAllocateMemoryWithType(ULONG MemorySize, TYPE_OF_MEMORY MemoryType)
|
|||
PVOID MmHeapAlloc(ULONG MemorySize)
|
||||
{
|
||||
PVOID Result;
|
||||
LONG CurAlloc, TotalFree, MaxFree, NumberOfGets, NumberOfRels;
|
||||
|
||||
if (MemorySize > MM_PAGE_SIZE)
|
||||
{
|
||||
|
@ -99,13 +98,17 @@ PVOID MmHeapAlloc(ULONG MemorySize)
|
|||
{
|
||||
DPRINTM(DPRINT_MEMORY, "Heap allocation for %d bytes failed\n", MemorySize);
|
||||
}
|
||||
#if MM_DBG
|
||||
{
|
||||
LONG CurAlloc, TotalFree, MaxFree, NumberOfGets, NumberOfRels;
|
||||
|
||||
// Gather some stats
|
||||
bstats(&CurAlloc, &TotalFree, &MaxFree, &NumberOfGets, &NumberOfRels);
|
||||
|
||||
DPRINTM(DPRINT_MEMORY, "Current alloced %d bytes, free %d bytes, allocs %d, frees %d\n",
|
||||
CurAlloc, TotalFree, NumberOfGets, NumberOfRels);
|
||||
// Gather some stats
|
||||
bstats(&CurAlloc, &TotalFree, &MaxFree, &NumberOfGets, &NumberOfRels);
|
||||
|
||||
DPRINTM(DPRINT_MEMORY, "Current alloced %d bytes, free %d bytes, allocs %d, frees %d\n",
|
||||
CurAlloc, TotalFree, NumberOfGets, NumberOfRels);
|
||||
}
|
||||
#endif
|
||||
return Result;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue