From 6dc208237977886056622b307941900658288e13 Mon Sep 17 00:00:00 2001 From: Shane Kearns Date: Wed, 28 Oct 2009 10:41:17 +0100 Subject: Add the new allocator to corelib New export in corelib that is called from the qtmain wrapper to setup the thread heap. This allows 7k of code to be shared, and makes it easier to disable or upgrade the allocator in future releases Task-number: QTBUG-4895 Enable new allocator by default Rename of headers as _p.h to avoid syncqt adding them to applications move inline functions from .inl -> .h, document & rename macros remove #if 0 from the dla header, implement getpagesize properly squashed after sanitisation Task-number: QT-3967 Reviewed-by: mread --- src/s60main/newallocator_hook.cpp | 56 +++++++++++++++++++++++++++++++++++++++ src/s60main/s60main.pro | 3 ++- 2 files changed, 58 insertions(+), 1 deletion(-) create mode 100644 src/s60main/newallocator_hook.cpp (limited to 'src/s60main') diff --git a/src/s60main/newallocator_hook.cpp b/src/s60main/newallocator_hook.cpp new file mode 100644 index 0000000000..839f79a29d --- /dev/null +++ b/src/s60main/newallocator_hook.cpp @@ -0,0 +1,56 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the Symbian application wrapper of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ +#include +#include + +Q_CORE_EXPORT TInt qt_symbian_SetupThreadHeap(TBool aNotFirst, SStdEpocThreadCreateInfo& aInfo); + +/* + * \internal + * + * Uses link-time symbol preemption to capture a call from the application + * startup. On return, there is some kind of heap allocator installed on the + * thread. + */ +TInt UserHeap::SetupThreadHeap(TBool aNotFirst, SStdEpocThreadCreateInfo& aInfo) +{ + return qt_symbian_SetupThreadHeap(aNotFirst, aInfo); +} diff --git a/src/s60main/s60main.pro b/src/s60main/s60main.pro index a273897187..664f155f7d 100644 --- a/src/s60main/s60main.pro +++ b/src/s60main/s60main.pro @@ -14,7 +14,8 @@ symbian { CONFIG -= jpeg INCLUDEPATH += tmp $$QMAKE_INCDIR_QT/QtCore $$MW_LAYER_SYSTEMINCLUDE SOURCES = qts60main.cpp \ - qts60main_mcrt0.cpp + qts60main_mcrt0.cpp \ + newallocator_hook.cpp # s60main needs to be built in ARM mode for GCCE to work. CONFIG += do_not_build_as_thumb -- cgit v1.2.3 From 40b413ca994fd26404672cefa71dc36fd2626b67 Mon Sep 17 00:00:00 2001 From: mread Date: Wed, 22 Sep 2010 13:27:15 +0100 Subject: Qt apps to use the Symbian^4 fast allocator in pre-Symbian^4 platforms The hybrid heap allocator has been copied from Symbian^4 (MCL wk36 initially) and is installed by qtmain.lib as the initial allocator for Qt apps. Task-number: QT-3967 Reviewed-by: Shane Kearns --- src/s60main/newallocator_hook.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'src/s60main') diff --git a/src/s60main/newallocator_hook.cpp b/src/s60main/newallocator_hook.cpp index 839f79a29d..982592040f 100644 --- a/src/s60main/newallocator_hook.cpp +++ b/src/s60main/newallocator_hook.cpp @@ -40,16 +40,17 @@ ****************************************************************************/ #include #include +#include Q_CORE_EXPORT TInt qt_symbian_SetupThreadHeap(TBool aNotFirst, SStdEpocThreadCreateInfo& aInfo); -/* - * \internal + +/* \internal * * Uses link-time symbol preemption to capture a call from the application * startup. On return, there is some kind of heap allocator installed on the * thread. - */ +*/ TInt UserHeap::SetupThreadHeap(TBool aNotFirst, SStdEpocThreadCreateInfo& aInfo) { return qt_symbian_SetupThreadHeap(aNotFirst, aInfo); -- cgit v1.2.3 From 2a8c5d045a88633fab8d86e56ad0f2fa7c8608c1 Mon Sep 17 00:00:00 2001 From: mread Date: Mon, 27 Sep 2010 11:17:53 +0100 Subject: removing need for u32std.h in s60main newallocator_hook.cpp had #include for the definition of SStdEpocThreadCreateInfo. This header is not available in earlier S60 platforms. But we do not need the full definition of SStdEpocThreadCreateInfo, so a forward declaration is used instead. Task-number: QT-3967 Reviewed-by: Shane Kearns --- src/s60main/newallocator_hook.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/s60main') diff --git a/src/s60main/newallocator_hook.cpp b/src/s60main/newallocator_hook.cpp index 982592040f..9cc6afb728 100644 --- a/src/s60main/newallocator_hook.cpp +++ b/src/s60main/newallocator_hook.cpp @@ -40,7 +40,8 @@ ****************************************************************************/ #include #include -#include + +struct SStdEpocThreadCreateInfo; Q_CORE_EXPORT TInt qt_symbian_SetupThreadHeap(TBool aNotFirst, SStdEpocThreadCreateInfo& aInfo); -- cgit v1.2.3