Update contrib.
1 // Copyright (c) 1997-2009 Nokia Corporation and/or its subsidiary(-ies).
2 // All rights reserved.
3 // This component and the accompanying materials are made available
4 // under the terms of the License "Eclipse Public License v1.0"
5 // which accompanies this distribution, and is available
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
8 // Initial Contributors:
9 // Nokia Corporation - initial contribution.
14 // e32test\heap\t_hcomp.cpp
15 // Causes lots of chunk compression without using much memory
16 // Won't work on WINS unless memory allocation limits are set.
22 #include <e32std_private.h>
25 const TUint size64k = 64*1024;
27 GLDEF_C TInt E32Main()
31 me.SetPriority(EPriorityHigh);
33 TMemoryInfoV1Buf membuf;
34 UserHal::MemoryInfo(membuf);
35 TInt maxmem=membuf().iTotalRamInBytes;
36 TInt heapsize=maxmem*2;
38 RHeap* heap1=User::ChunkHeap(NULL,size64k,heapsize+size64k);
44 TUint8* ptr=(TUint8*)heap1->Alloc(heapsize); // fail, compress, fail
45 User::After(1000); // quite soon