diff -r 51a74ef9ed63 -r ae94777fff8f Symbian3/SDK/Source/GUID-0185D5DC-5142-42C3-8FFB-8EB76D49AB06.dita --- a/Symbian3/SDK/Source/GUID-0185D5DC-5142-42C3-8FFB-8EB76D49AB06.dita Wed Mar 31 11:11:55 2010 +0100 +++ b/Symbian3/SDK/Source/GUID-0185D5DC-5142-42C3-8FFB-8EB76D49AB06.dita Fri Jun 11 12:39:03 2010 +0100 @@ -1,52 +1,52 @@ - - - - - -Requesting -RAM SynchronouslyThis section describes how an application can request for free -RAM synchronously. -

Perform the steps -described in Allowing -Large Memory Allocation.

-

Requesting -free RAM synchronously is easy to implement because no active object is needed -and is recommended when there is no need to perform any other task while waiting -for the request to complete. This approach is not recommended in case of a -server, as synchronous call blocks the server and it cannot serve its clients -during synchronous wait.

- -Request free memory. - User::LeaveIfError(iOomMonitorSession.RequestFreeMemory(KLargeValueToAllocate)); -DoFunctionRequiring_KLargeValueToAllocate_Bytes(); - - -

The following code snippet illustrates an synchronous request -for 2MB RAM:

TInt KLargeValueToAllocate = 2097152; //2MB - -// Create an OOM Monitor session -ROomMonitorSession oomMonitorSession; -CleanUpClosePushL(oomMonitorSession); -User::LeaveIfError(oomMonitorSession.Connect()); - -// Request free memory -User::LeaveIfError(iOomMonitorSession.RequestFreeMemory(KLargeValueToAllocate)); -DoFunctionRequiring_KLargeValueToAllocate_Bytes(); - -// Tidy up -CleanupStack::PopAndDestroy(); //oomMonitorSession, calls Close() -
-
-OOM Monitor -Priority -OOM Monitor -Overview -OOM Monitor -Reference + + + + + +Requesting +RAM SynchronouslyThis section describes how an application can request for free +RAM synchronously. +

Perform the steps +described in Allowing +Large Memory Allocation.

+

Requesting +free RAM synchronously is easy to implement because no active object is needed +and is recommended when there is no need to perform any other task while waiting +for the request to complete. This approach is not recommended in case of a +server, as synchronous call blocks the server and it cannot serve its clients +during synchronous wait.

+ +Request free memory. + User::LeaveIfError(iOomMonitorSession.RequestFreeMemory(KLargeValueToAllocate)); +DoFunctionRequiring_KLargeValueToAllocate_Bytes(); + + +

The following code snippet illustrates an synchronous request +for 2MB RAM:

TInt KLargeValueToAllocate = 2097152; //2MB + +// Create an OOM Monitor session +ROomMonitorSession oomMonitorSession; +CleanUpClosePushL(oomMonitorSession); +User::LeaveIfError(oomMonitorSession.Connect()); + +// Request free memory +User::LeaveIfError(iOomMonitorSession.RequestFreeMemory(KLargeValueToAllocate)); +DoFunctionRequiring_KLargeValueToAllocate_Bytes(); + +// Tidy up +CleanupStack::PopAndDestroy(); //oomMonitorSession, calls Close() +
+
+OOM Monitor +Priority +OOM Monitor +Overview +OOM Monitor +Reference
\ No newline at end of file