--- a/emailuis/emailui/src/FreestyleEmailUi.cpp Mon Jun 21 15:20:54 2010 +0300
+++ b/emailuis/emailui/src/FreestyleEmailUi.cpp Thu Jul 15 18:19:25 2010 +0300
@@ -1,5 +1,5 @@
/*
-* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies).
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies).
* All rights reserved.
* This component and the accompanying materials are made available
* under the terms of "Eclipse Public License v1.0"
@@ -21,6 +21,10 @@
#include "FreestyleEmailUiDocument.h"
#include "FreestyleEmailUiConstants.h"
#include <eikstart.h>
+#include <u32std.h>
+#include <MemoryManager.h>
+
+#define __USE_FAST_ALLOCATOR
CApaDocument* CFreestyleEmailUiApplication::CreateDocumentL()
{
@@ -41,10 +45,42 @@
return new CFreestyleEmailUiApplication;
}
+#ifdef __USE_FAST_ALLOCATOR
+EXPORT_C TInt UserHeap::SetupThreadHeap( TBool aSubThread, SStdEpocThreadCreateInfo& aInfo )
+ {
+ TInt error( KErrNone );
+ if (!aInfo.iAllocator && aInfo.iHeapInitialSize>0)
+ {
+ // new heap required
+ RHeap* pH = NULL;
+ error = CreateThreadHeap(aInfo, pH);
+ if (!error && !aSubThread)
+ {
+ // main thread - new allocator created and set as default heap
+ MemoryManager::CreateFastAllocator();
+ }
+ }
+ else if (aInfo.iAllocator)
+ {
+ // sharing a heap
+ RAllocator* pA = aInfo.iAllocator;
+ error = pA->Open();
+ if (!error)
+ {
+ User::SwitchAllocator(pA);
+ }
+ }
+ return error;
+ }
+#endif // __USE_FAST_ALLOCATOR
GLDEF_C TInt E32Main()
{
+#ifdef __USE_FAST_ALLOCATOR
+ // initialize MemmoryManager
+ MemoryManager::InitFastAllocator();
+#endif // __USE_FAST_ALLOCATOR
return EikStart::RunApplication(NewApplication);
}
-
+