Why "__UHEAP_FAILNEXT" doesn't work in UIQ??
| Mon, 2007-04-23 12:41 | |
|
I tried the following code in both S60 3rd SDK and UIQ3 SDK: void CabcdefgAppView::ConstructL( const TRect& aRect ) { __UHEAP_MARK; __UHEAP_FAILNEXT(3); TRAPD( err, DoSth() ); if( err != KErrNone ) { TInt e = err; } __UHEAP_MARKEND; __UHEAP_RESET; } void CabcdefgAppView::DoSth() { for( TInt i = 0; i < 10; i++ ) { HBufC* buf; buf = HBufC::NewLC( 100 ); CleanupStack::PopAndDestroy(); } } __UHEAP_FAILNEXT(3); will cause the memroy allocation leave in S60 3rd just as I expected. But in UIQ3 SDK, I can't see any leave. The return value of TRAPD( err, DoSth() ); is KErrNone, which is 0. I tried to press ctrl+alt+shift+p to do some setting in UIQ emulator, but it either didn't make sense or I didn't set it right. Did I miss something?? Thank you in advance. ![]() Taking you forward. |
|






Forum posts: 285
One more thing is DoSth should be DoSthL according to Symbian standard as it is a leaving function.
Cheers,
Sri
Forum posts: 27
2. I agree I should modify the function name to DoSthL
Did anybody else try this before?
Taking you forward.
Forum posts: 1155
These are used a lot by anyone that writes symbian code professionally.
I havn't used UIQ3 though.
You could always try to skip useing the macro and use the function calls directly.
User::Heap().__DbgMarkStart()
User::Heap().__DbgMarkEnd(..);
and
User::Heap().__DbgSetAllocFail(...)
Forum posts: 364
Why do you think this has go anything to do with it?
Forum posts: 27
Some one tell me why?
Taking you forward.