Join Now
Quality Rating:
  • Currently 0.0 / 5
(0.0 / 5 - 0 votes cast)
Expertise Level:
  • Currently 0.0 / 5
(0.0 / 5 - 0 votes cast)

This page was last modified 09:23, 11 December 2007.

Overuse of TFileName

From Forum Nokia Wiki

Each wide character is equivalent to two bytes so each time if you create and use a TFileName object on the stack you are setting aside 524 bytes (2 × 256 descriptor data bytes + 12 for the descriptor object itself) regardless of whether they all are actually required for the file name or not.

The standard stack size on Symbian OS is just 8 KB, so it’s always good not to allocate stack-based TFileName objects or pass them around by value, since unnecessary use of this restricted resource is very wasteful. You could, of course, use them on the heap, say as members of C classes. But if you are unlikely need the full path length, you should aim to use an HBufC or some other heap based descriptors, since it is a good practice to consume as little memory as necessary.


Related Links


Related Discussions
Thread Thread Starter Forum Replies Last Post
Playing video files one after the other architgupta General Symbian C++ 11 2005-07-28 10:39
CBase issue arunpirku General Symbian C++ 13 2007-11-20 10:41
autostart an application leuchovius General Symbian C++ 44 2008-04-21 00:55
请问如何获取程序的安装路径。 billqu Symbian 1 2006-05-02 15:53
有关编写输入法的问题 btt0128 Symbian 0 2006-07-13 02:26
 
Powered by MediaWiki
     
     RDF Facets:
     
     
     qfnZtypeQUqfnTypeZCommunityContentQ
     qfnZtypeQUqfnTypeZWebpageQ
     qfnZtypeQUqfnTypeZWikiContentQ
     qmarsZlanguageQUxhttpE3aE2fE2fswE2enokiaE2ecomE2flanguageE2d1E2fenX