# HG changeset patch # User William Roberts # Date 1289562144 0 # Node ID 8ee165fddeb65b0814cc62f46573eb634e747527 # Parent e1987ab3768a76f3782b42bd8e0fabca26be313a Change HuiStatic.cpp to avoid VFP instructions in the static initialiser - avoids Bug 3937 diff -r e1987ab3768a -r 8ee165fddeb6 uiacceltk/hitchcock/coretoolkit/src/HuiStatic.cpp --- a/uiacceltk/hitchcock/coretoolkit/src/HuiStatic.cpp Wed Oct 13 15:34:15 2010 +0300 +++ b/uiacceltk/hitchcock/coretoolkit/src/HuiStatic.cpp Fri Nov 12 11:42:24 2010 +0000 @@ -38,9 +38,13 @@ #include "alfcommanddebug.h" #endif +#ifdef __WINSCW__ +#define HUISTATIC_USE_TLS +#endif + // Global writeable data, used in HW instead of TLS which relatively slow -#ifndef __WINSCW__ -TTlsData globalWriteableData; +#ifndef HUISTATIC_USE_TLS +TTlsData* globalWriteableDataPtr = 0; #endif void CleanupWg(TAny* aWg) @@ -396,8 +400,8 @@ iData->iCommandDebugger = CAlfCommandDebug::NewL(); #endif -#ifndef __WINSCW__ - globalWriteableData = *iData; +#ifndef HUISTATIC_USE_TLS + globalWriteableDataPtr = iData; #ifdef USE_MODULE_TEST_HOOKS_FOR_ALF // For testing purposes, test data needs to be included into TLS // because test cases require information stored in TLS. @@ -438,7 +442,12 @@ } iChangeNotifier->Cancel(); delete iChangeNotifier; -#if defined( __WINSCW__ ) || defined( USE_MODULE_TEST_HOOKS_FOR_ALF ) +#ifndef HUISTATIC_USE_TLS + globalWriteableDataPtr = 0; + #ifdef USE_MODULE_TEST_HOOKS_FOR_ALF + Dll::FreeTls(); + #endif +#else Dll::FreeTls(); #endif delete iData; @@ -447,8 +456,8 @@ EXPORT_C TTlsData* CHuiStatic::Data() { -#ifndef __WINSCW__ - return &globalWriteableData; +#ifndef HUISTATIC_USE_TLS + return globalWriteableDataPtr; #else return static_cast(Dll::Tls()); #endif