Author: fireball
Date: Sun Jan 27 17:18:30 2008
New Revision: 32029
URL:
http://svn.reactos.org/svn/reactos?rev=32029&view=rev
Log:
- Make small allocations from the heap.
Modified:
trunk/reactos/boot/freeldr/freeldr/cache/blocklist.c
trunk/reactos/boot/freeldr/freeldr/cache/cache.c
Modified: trunk/reactos/boot/freeldr/freeldr/cache/blocklist.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/freeldr/cache…
==============================================================================
--- trunk/reactos/boot/freeldr/freeldr/cache/blocklist.c (original)
+++ trunk/reactos/boot/freeldr/freeldr/cache/blocklist.c Sun Jan 27 17:18:30 2008
@@ -98,7 +98,7 @@
// We will need to add the block to the
// drive's list of cached blocks. So allocate
// the block memory.
- CacheBlock = MmAllocateMemory(sizeof(CACHE_BLOCK));
+ CacheBlock = MmHeapAlloc(sizeof(CACHE_BLOCK));
if (CacheBlock == NULL)
{
return NULL;
@@ -111,7 +111,7 @@
CacheBlock->BlockData = MmAllocateMemory(CacheDrive->BlockSize *
CacheDrive->BytesPerSector);
if (CacheBlock->BlockData ==NULL)
{
- MmFreeMemory(CacheBlock);
+ MmHeapFree(CacheBlock);
return NULL;
}
@@ -119,7 +119,7 @@
if (!MachDiskReadLogicalSectors(CacheDrive->DriveNumber, (BlockNumber *
CacheDrive->BlockSize), CacheDrive->BlockSize, (PVOID)DISKREADBUFFER))
{
MmFreeMemory(CacheBlock->BlockData);
- MmFreeMemory(CacheBlock);
+ MmHeapFree(CacheBlock);
return NULL;
}
RtlCopyMemory(CacheBlock->BlockData, (PVOID)DISKREADBUFFER, CacheDrive->BlockSize
* CacheDrive->BytesPerSector);
@@ -162,7 +162,7 @@
// Free the block memory and the block structure
MmFreeMemory(CacheBlockToFree->BlockData);
- MmFreeMemory(CacheBlockToFree);
+ MmHeapFree(CacheBlockToFree);
// Update the cache data
CacheBlockCount--;
Modified: trunk/reactos/boot/freeldr/freeldr/cache/cache.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/freeldr/cache…
==============================================================================
--- trunk/reactos/boot/freeldr/freeldr/cache/cache.c (original)
+++ trunk/reactos/boot/freeldr/freeldr/cache/cache.c Sun Jan 27 17:18:30 2008
@@ -71,7 +71,7 @@
ListEntry);
MmFreeMemory(NextCacheBlock->BlockData);
- MmFreeMemory(NextCacheBlock);
+ MmHeapFree(NextCacheBlock);
}
}