Actually i m working in a project where many times this function has been invoked If i invoke CloseSTDLIB() function at the time of application exit it can free memory that time . But i need to free memory as my program flows .
Can anybody tell me the prototype of sscanf using TLex or other way round ??
It doesn't matter how many times you use the same function, it will not allocate more memory then if you call it once I would say.
The reason it does allocate memory is because the standard implementations of many stdlib functions like printf and scanf is using a static local buffer for temporary string storage.
But since writable static data isn't supported in symbian dlls, the symbian implementation will use TLS (Thread local storage, one pointer of writable static data per loaded dll is allowed), and allocate the buffer here.
For performance reasons you don't want to reallocate this buffer each time the functions is called, so it is only done on the first call, and then it will be reused in the following calls.
This can be easily checked through User::Heap().AllocSize(), if you don't think it sounds reasonable. (I havn't actually double checked it myself, but would be surprised if it worked otherwise)
Forum posts: 1246
Probably because sscanf is a pretty funky function to begin with
Maybe you can use TLex8 for your needs.
Why do you not want to invoke CloseSTDLIB?
Forum posts: 42
If i invoke CloseSTDLIB() function at the time of application exit it can free memory that time . But i need to free memory as my program flows .
Can anybody tell me the prototype of sscanf using TLex or other way round ??
Forum posts: 1246
The reason it does allocate memory is because the standard implementations of many stdlib functions like printf and scanf is using a static local buffer for temporary string storage.
But since writable static data isn't supported in symbian dlls, the symbian implementation will use TLS (Thread local storage, one pointer of writable static data per loaded dll is allowed), and allocate the buffer here.
For performance reasons you don't want to reallocate this buffer each time the functions is called, so it is only done on the first call, and then it will be reused in the following calls.
This can be easily checked through User::Heap().AllocSize(), if you don't think it sounds reasonable. (I havn't actually double checked it myself, but would be surprised if it worked otherwise)
Forum posts: 42
Thanku very much.