Community: Wiki

你在这里: You Are Here: Olet tässä: Vous êtes ici: Sie befinden sich hier: Tu sei qui: 現在のページ: Você está aqui: Вы здесь: Usted está aquí:
This page was last modified 06:50, 24 April 2007.

Writeable static data

From Forum Nokia Wiki

Global Writeable Static Data (WSD) pre-process variables that exists during the lifetime of the process. Sometimes we need WSD for defining variables that are used in some other files. This case is usually happen when porting code from non-Symbian OS enviroment.


WSD on EKA1

EKA1 (EPOC_Kernel_Architecture_1), which is used on Symbian OS 6.1, 7.0, 7.0s, 8.0a, 8.1a, support WSD in EXE only. We cannot define WSD on DLL or APP. If we try to define it, the compiler will report "initialized data" error message.

There are some workarounds to use WSD on EKA1:

  • Use TLS (Thread Local Storage). Please check Symbian FAQ and Tech Tips for an example of how to use TLS to define WSD.
  • Move global variables into classes. This may involve a lot of works, especially if we use global variables in many different places.
  • Use ECompXL. Although ECompXL was originally developed to compress executable on Symbian OS, there is a "side effect" that developers can now define WSD.


WSD on EKA2

EKA2 (EPOC_Kernel_Architecture_2), which is used on Symbian OS 8.0b, 8.1b and the newer version 9, support WSD in EXE and DLL. However, there is a little bit trick for DLL because we have to add the following macro to the .mmp file:

EPOCALLOWDLLDATA

There is some cost, though, which needs to be carefully considered when using WSD on EKA2. Just a quick list of what has to be taken into account:

  • EKA2 Emulator only allows a DLL with WSD to load into a single process
  • RAM usage for WSD data chunk
  • Chunks are a finite resource on ARMv5
  • Limit on the number of DLLs in a process with WSD.

References

Rate This

 
Bookmark this page: DeliciousDiggFacebookGoogleYahooStumbleUponRedditFurlTechnocratiMagnoliaTwitter  Share this page Share this page Invite a friend Invite a friend
E-mail Newsletters Press Terms & Conditions Privacy Policy Sitemap Contact Us Regional websites: Chinese Japanese © 2008 Nokia 
RDF Facets: qfnZtopicQUqfnTopicZseriesE5f60Q qfnZtypeQUqfnTypeZCommunityContentQ qfnZtypeQUqfnTypeZWebpageQ qfnZtypeQUqfnTypeZWikiContentQ qmarsZlanguageQUxhttpE3aE2fE2fswE2enokiaE2ecomE2flanguageE2d1E2fenX