diff -r a179b74831c9 -r c1f20ce4abcf kernel/eka/euser/us_ksvr.cpp --- a/kernel/eka/euser/us_ksvr.cpp Thu Aug 19 11:14:22 2010 +0300 +++ b/kernel/eka/euser/us_ksvr.cpp Tue Aug 31 16:34:26 2010 +0300 @@ -505,10 +505,10 @@ */ void TChunkCreateInfo::SetThreadHeap(TInt aInitialSize, TInt aMaxSize, const TDesC& aName) { - iType = TChunkCreate::ENormal | TChunkCreate::EData; + iType = TChunkCreate::ENormal | TChunkCreate::EData; + iMaxSize = aMaxSize; iInitialBottom = 0; iInitialTop = aInitialSize; - iMaxSize = aMaxSize; iAttributes |= TChunkCreate::ELocalNamed; iName = &aName; iOwnerType = EOwnerThread; @@ -4772,6 +4772,33 @@ GetHeap()->__DbgSetAllocFail(aType,aRate); } +UEXPORT_C RAllocator::TAllocFail User::__DbgGetAllocFail(TBool aKernel) +// +// Obtains the current heap failure simulation type. +// +/** +After calling __DbgSetAllocFail(), this function may be called to retrieve the +value set. This is useful primarily for test code that doesn't know if a heap +has been set to fail and needs to check. + +@param aKernel ETrue, if checking is being done for the kernel heap; + EFalse, if checking is being done for the current thread's + default heap. + +@return RAllocator::ENone if heap is not in failure simulation mode; + Otherwise one of the other RAllocator::TAllocFail enumerations +*/ + { + if (aKernel) + { + RAllocator::TAllocFail allocFail; + Exec::KernelHeapDebug(EDbgGetAllocFail, 0, &allocFail); + return(allocFail); + } + else + return(GetHeap()->__DbgGetAllocFail()); + } + /** Simulates a heap allocation failure for the current thread's default heap, or the kernel heap.