You Are Here:

Community: Wiki

This page was last modified on 24 April 2007, at 06:50.

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: DeliciousDiggFacebookGoogleYahooStumbleUponRedditDiigoTechnocratiTwitter  Share this page Share this page Print this Page Print this page Invite a friend Invite a friend
京ICP备05048969号    Email Newsletters Press Terms & Conditions Privacy Policy Sitemap Contact Us © 2009 Nokia 
RDF Facets: qdcZidentifierQSxhttpE3aE2fE2fwikiE2eforumE2enokiaE2ecomE2findeE78E2ephpE2fE25E455E25A6E2582E25E454E25BE44E2595E25E455E259CE25A8E25E456E2594E25B6E25E454E25BBE25B6E25E457E25AE45E25B1E25E455E2588E259BE25E455E25BBE25BAE25E457E259FE25AE44E25E454E25BFE25A1X qdcZtypeQUqfnZE45E78cludedFromGeneralE4cistingsQ qdcZtypeQUqfntypeZCommunityContentQ qdcZtypeQUqfntypeZE52esourceQ qdcZtypeQUqfntypeZWebpageQ qdcZtypeQUqfntypeZWikiContentQ qdcZtypeQUqmarsZManagedE52esourceQ qdcZtypeQUqwebZInformationE52esourceQ qdcZtypeQUqwebZPageQ qdcZtypeQUqwebZE52esourceQ qdcZtypeQUqrdfsZE52esourceQ qfnZtopicQUqfnTopicZseriesE5f60Q qfnZtypeQUqfntypeZCommunityContentQ qfnZtypeQUqfntypeZE52esourceQ qfnZtypeQUqfntypeZWebpageQ qfnZtypeQUqfntypeZWikiContentQ qfnZuserE5ftagQSxs60X qmarsZlanguageQUxhttpE3aE2fE2fswE2enokiaE2ecomE2flanguageE2d1E2fenX qrdfZtypeQUqfnZE45E78cludedFromGeneralE4cistingsQ qrdfZtypeQUqfntypeZCommunityContentQ qrdfZtypeQUqfntypeZE52esourceQ qrdfZtypeQUqfntypeZWebpageQ qrdfZtypeQUqfntypeZWikiContentQ qrdfZtypeQUqmarsZManagedE52esourceQ qrdfZtypeQUqwebZInformationE52esourceQ qrdfZtypeQUqwebZPageQ qrdfZtypeQUqwebZE52esourceQ qrdfZtypeQUqrdfsZE52esourceQ