webengine/osswebengine/MemoryManager/Src/MemoryManager.cpp
changeset 8 7c90e6132015
parent 0 dd21522fd290
child 13 10e98eab6f85
--- a/webengine/osswebengine/MemoryManager/Src/MemoryManager.cpp	Mon Mar 30 12:54:55 2009 +0300
+++ b/webengine/osswebengine/MemoryManager/Src/MemoryManager.cpp	Fri May 08 08:25:06 2009 +0300
@@ -53,10 +53,17 @@
     {
     // create the right memory pool
     __ASSERT_DEBUG( s_pool == 0, User::Panic( KMemManPanicDes, 0 ) );
+#ifdef __NEW_ALLOCATOR__
+    s_pool = new CNewSymbianHeapPool();
+    s_pool->Create();
+    RSymbianDlAllocatorWrapper* allocator = new RSymbianDlAllocatorWrapper((CNewSymbianHeapPool*)s_pool);
+    return User::SwitchAllocator( allocator );
+#else
     s_pool = new CFastMemoryPool();
     s_pool->Create();
     RFastAllocator* allocator = new RFastAllocator((CFastMemoryPool*)s_pool);
     return User::SwitchAllocator( allocator );
+#endif
     }
 
 //-----------------------------------------------------------------------------
@@ -64,8 +71,13 @@
 //-----------------------------------------------------------------------------
 EXPORT_C void MemoryManager::CloseFastAllocator(RAllocator* aDefaultAllocator)
     {
+#ifdef __NEW_ALLOCATOR__
+    RAllocator* allocator = User::SwitchAllocator( aDefaultAllocator );
+    delete (RSymbianDlAllocatorWrapper*)(allocator);
+#else
     RAllocator* allocator = User::SwitchAllocator( aDefaultAllocator );
     delete (RFastAllocator*)(allocator);
+#endif
     }
 
 //-----------------------------------------------------------------------------