Author: sir_richard
Date: Tue Nov 23 17:29:40 2010
New Revision: 49756
URL: http://svn.reactos.org/svn/reactos?rev=49756&view=rev
Log:
[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).
Modified:
trunk/reactos/boot/freeldr/freeldr/mm/mm.c
Modified: trunk/reactos/boot/freeldr/freeldr/mm/mm.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/freeldr/mm/mm…
==============================================================================
--- trunk/reactos/boot/freeldr/freeldr/mm/mm.c [iso-8859-1] (original)
+++ trunk/reactos/boot/freeldr/freeldr/mm/mm.c [iso-8859-1] Tue Nov 23 17:29:40 2010
@@ -85,7 +85,6 @@
PVOID MmHeapAlloc(ULONG MemorySize)
{
PVOID Result;
- LONG CurAlloc, TotalFree, MaxFree, NumberOfGets, NumberOfRels;
if (MemorySize > MM_PAGE_SIZE)
{
@@ -99,13 +98,17 @@
{
DPRINTM(DPRINT_MEMORY, "Heap allocation for %d bytes failed\n", MemorySize);
}
-
- // 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);
-
+#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);
+ }
+#endif
return Result;
}
Author: sir_richard
Date: Tue Nov 23 17:23:47 2010
New Revision: 49751
URL: http://svn.reactos.org/svn/reactos?rev=49751&view=rev
Log:
[FREELDR]: Define FreeLoader module for ARM. Differences with x86 are mostly due to the fact "bootloader" was unfortunately made an x86-specific module type, so we have to use "kernel" to get around that, which thankfully has remained portable.
Modified:
trunk/reactos/boot/freeldr/freeldr/freeldr.rbuild
Modified: trunk/reactos/boot/freeldr/freeldr/freeldr.rbuild
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/freeldr/freel…
==============================================================================
--- trunk/reactos/boot/freeldr/freeldr/freeldr.rbuild [iso-8859-1] (original)
+++ trunk/reactos/boot/freeldr/freeldr/freeldr.rbuild [iso-8859-1] Tue Nov 23 17:23:47 2010
@@ -13,6 +13,22 @@
<library>rtl</library>
<library>libcntpr</library>
<library>ppcmmu</library>
+ </module>
+</if>
+
+<if property="ARCH" value="arm">
+ <module name="freeldr" type="kernel" entrypoint="_start" baseaddress="$(BASEADDRESS_FREELDR)">
+ <linkerscript>freeldr_$(ARCH).lnk</linkerscript>
+ <bootstrap installbase="loader" />
+ <library>freeldr_startup</library>
+ <library>freeldr_base64k</library>
+ <library>freeldr_base</library>
+ <library>freeldr_arch</library>
+ <library>freeldr_main</library>
+ <library>rossym</library>
+ <library>cmlib</library>
+ <library>rtl</library>
+ <library>libcntpr</library>
</module>
</if>