16 described in <xref href="GUID-50CA5439-29A1-426C-83BA-EC048FE86CDE.dita">Allowing |
16 described in <xref href="GUID-50CA5439-29A1-426C-83BA-EC048FE86CDE.dita">Allowing |
17 Large Memory Allocation</xref>.</p></prereq> |
17 Large Memory Allocation</xref>.</p></prereq> |
18 <context id="GUID-D36C0590-A436-458B-B7A6-F2E8577E26C6"> <p>Requesting |
18 <context id="GUID-D36C0590-A436-458B-B7A6-F2E8577E26C6"> <p>Requesting |
19 free RAM asynchronously is recommended as the application is not blocked during |
19 free RAM asynchronously is recommended as the application is not blocked during |
20 the method call handling.</p> </context> |
20 the method call handling.</p> </context> |
21 <steps id="GUID-4DD07DEC-6017-4237-BE46-1D69E5FBD744-GENID-1-12-1-12-1-1-9-1-5-1-6-1-6-1-5-1-3-3"> |
21 <steps id="GUID-4DD07DEC-6017-4237-BE46-1D69E5FBD744-GENID-1-12-1-13-1-1-9-1-5-1-6-1-6-1-5-1-3-3"> |
22 <step id="GUID-9A69E5AD-E938-4092-A8C2-CB65C37C8962-GENID-1-12-1-12-1-1-9-1-5-1-6-1-6-1-5-1-3-3-1"><cmd>Start an asynchronous |
22 <step id="GUID-9A69E5AD-E938-4092-A8C2-CB65C37C8962-GENID-1-12-1-13-1-1-9-1-5-1-6-1-6-1-5-1-3-3-1"><cmd>Start an asynchronous |
23 request for a block of memory.</cmd> |
23 request for a block of memory.</cmd> |
24 <info><codeblock xml:space="preserve">CMemoryAllocatingObject::StartFunctionalityRequiringAllocationL() |
24 <info><codeblock xml:space="preserve">CMemoryAllocatingObject::StartFunctionalityRequiringAllocationL() |
25 { |
25 { |
26 User::LeaveIfError(iOomMonitorSession.Connect()); |
26 User::LeaveIfError(iOomMonitorSession.Connect()); |
27 iMemoryRequester = CMemoryRequester::NewL(iOomMonitorSession, *this); |
27 iMemoryRequester = CMemoryRequester::NewL(iOomMonitorSession, *this); |
28 iMemoryRequester->Start(KLargeValueToAllocate); |
28 iMemoryRequester->Start(KLargeValueToAllocate); |
29 } |
29 } |
30 </codeblock></info> |
30 </codeblock></info> |
31 </step> |
31 </step> |
32 <step id="GUID-9A69E5AD-E938-4092-A8C2-CB65C37C8962-GENID-1-12-1-12-1-1-9-1-5-1-6-1-6-1-5-1-3-3-2"><cmd>Implement the active |
32 <step id="GUID-9A69E5AD-E938-4092-A8C2-CB65C37C8962-GENID-1-12-1-13-1-1-9-1-5-1-6-1-6-1-5-1-3-3-2"><cmd>Implement the active |
33 object and request for free memory.</cmd> |
33 object and request for free memory.</cmd> |
34 <info><codeblock xml:space="preserve">void CMemoryRequester::Start(TInt aBytesRequested) |
34 <info><codeblock xml:space="preserve">void CMemoryRequester::Start(TInt aBytesRequested) |
35 { |
35 { |
36 iOomMonitorSession.RequestFreeMemory(aBytesRequested, iStatus); |
36 iOomMonitorSession.RequestFreeMemory(aBytesRequested, iStatus); |
37 SetActive(); |
37 SetActive(); |