From 02749e2429d9ccc09f94febaf316da7803ecb922 Mon Sep 17 00:00:00 2001 From: Pawel Dziepak Date: Wed, 11 Dec 2013 01:59:31 +0100 Subject: [PATCH] x86/paging: Do not use array placement new Array placement new has implementation defined memory overhead what makes it pretty useless. --- .../kernel/arch/x86/paging/32bit/X86PagingMethod32Bit.cpp | 6 +++--- .../kernel/arch/x86/paging/pae/X86PagingMethodPAE.cpp | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/system/kernel/arch/x86/paging/32bit/X86PagingMethod32Bit.cpp b/src/system/kernel/arch/x86/paging/32bit/X86PagingMethod32Bit.cpp index e8e0419b07..64c93cf8be 100644 --- a/src/system/kernel/arch/x86/paging/32bit/X86PagingMethod32Bit.cpp +++ b/src/system/kernel/arch/x86/paging/32bit/X86PagingMethod32Bit.cpp @@ -295,10 +295,10 @@ X86PagingMethod32Bit::Init(kernel_args* args, // create the initial pools for the physical page mapper int32 poolCount = _GetInitialPoolCount(); - PhysicalPageSlotPool* pool - = new(&PhysicalPageSlotPool::sInitialPhysicalPagePool) - PhysicalPageSlotPool[poolCount]; + PhysicalPageSlotPool* pool = PhysicalPageSlotPool::sInitialPhysicalPagePool; + for (int32 i = 0; i < poolCount; i++) { + new(&pool[i]) PhysicalPageSlotPool; status_t error = pool[i].InitInitial(args); if (error != B_OK) { panic("X86PagingMethod32Bit::Init(): Failed to create initial pool " diff --git a/src/system/kernel/arch/x86/paging/pae/X86PagingMethodPAE.cpp b/src/system/kernel/arch/x86/paging/pae/X86PagingMethodPAE.cpp index 38d4e0e676..089f0ccb84 100644 --- a/src/system/kernel/arch/x86/paging/pae/X86PagingMethodPAE.cpp +++ b/src/system/kernel/arch/x86/paging/pae/X86PagingMethodPAE.cpp @@ -595,10 +595,10 @@ X86PagingMethodPAE::Init(kernel_args* args, // create the initial pools for the physical page mapper int32 poolCount = _GetInitialPoolCount(); - PhysicalPageSlotPool* pool - = new(&PhysicalPageSlotPool::sInitialPhysicalPagePool) - PhysicalPageSlotPool[poolCount]; + PhysicalPageSlotPool* pool = PhysicalPageSlotPool::sInitialPhysicalPagePool; + for (int32 i = 0; i < poolCount; i++) { + new(&pool[i]) PhysicalPageSlotPool; status_t error = pool[i].InitInitial(this, args); if (error != B_OK) { panic("X86PagingMethodPAE::Init(): Failed to create initial pool "