What does it mean that DLLs can't have Static writable data????
| Sat, 2006-04-08 06:31 | |
|
Hi,
I am new to Symbian.Plz Respond immediately if any body can help me. Can anybody tell what does it mean that DLLs can't have static writable data?? Does it mean that: class x { static TInt a; public: static void modify(); }; TInt x::a=5; void x::modify() { a=10; } Does it mean that above written piece of code will not work if we have placed this whole piece of code in DLL??? i mean can't we modify static variable named a?? Thanx & Regards, Amit Mahajan. |
|






Forum posts: 1242
Please go immediately to Google, type "Symbian static data" and read Â
René Brunner
Forum posts: 1232
The reason is an architectural design choice in how symbian dlls are implemented.
basicly, the dll code in ram is shared between all processes that use it. not loaded several times. Not allowing writeable static data simplifies the implementation, if you where to allow it, you had to allocate and keep track of a memory block for these variables for each process using th dll... a memory block that would have to be located at the same virtual memory address for each process useing them.. (since the code block should be the same for all) or really for each thread. And then it gets really messy.
Forum posts: 1242
See also this earlier post:
http://forum.newlc.com/index.php/topic,9526.0.html
René Brunner
Forum posts: 41
what i have concluded is that there is no way out to use static data in DLLs, n whatever ways exists to use static writable data for example: Using TLS, they will be very expensive for my applications n i don't want that.
Thanx again.