diff -r 48780e181b38 -r 578be2adaf3e Symbian3/PDK/Source/GUID-F0891698-F714-55AA-A089-790BB0B07AE4.dita --- a/Symbian3/PDK/Source/GUID-F0891698-F714-55AA-A089-790BB0B07AE4.dita Tue Jul 20 12:00:49 2010 +0100 +++ b/Symbian3/PDK/Source/GUID-F0891698-F714-55AA-A089-790BB0B07AE4.dita Fri Aug 13 16:47:46 2010 +0100 @@ -1,64 +1,64 @@ - - - - - - Allocation -TutorialThis tutorial describes how to allocate MBufs (for data source -components in the Data Plane). -

The RMBufChain::Alloc() function allocates -the specified amount of memory as a chain of one or several RMBuf objects -from the Comms pond. If the pond cannot provide the memory area as a single -buffer, the chain contains as many RMBuf s linked together -as necessary to fulfil the allocation request.

- -Create an instance -of RMBufChain. - -Call RMBufChain::Alloc(). -You should use the allocation methods of the parent class (RCommsBufChain): -see the TLS Look-up -Reduction Tutorial. -Note: some of the overloaded Alloc() methods specify -minimum and maximum values. See Allocation -Strategy. - -Check the return -value for errors. -The Alloc() methods return KErrNone if -the memory is available as RMBuf in the RMBufChain. - -Use the allocated -buffer (see Data Access -Example). - - -Examples

The following example requests 1,800 bytes -to the Comms pond. iAllocator is an RMBufAllocator member -of the class implementing this example.

-RMBufChain aChain; - -TInt err = chain.Alloc(1800, iAllocator); -

The following example requests 1,200 bytes and specifies a -minimum and a maximum size of 1,600 bytes. If there are no available 1,600-byte -buffers in the pond then an error is returned.

-RMBufChain chain; - -Tint err = chain.Alloc(1200, 1600, 1600, iAllocator); -
-
-Overview - -Comms Buffers -(MBuf) and Comms Chains -TLS Look-up -Reduction Tutorial -Allocation -Strategy + + + + + + Allocation +TutorialThis tutorial describes how to allocate MBufs (for data source +components in the Data Plane). +

The RMBufChain::Alloc() function allocates +the specified amount of memory as a chain of one or several RMBuf objects +from the Comms pond. If the pond cannot provide the memory area as a single +buffer, the chain contains as many RMBuf s linked together +as necessary to fulfil the allocation request.

+ +Create an instance +of RMBufChain. + +Call RMBufChain::Alloc(). +You should use the allocation methods of the parent class (RCommsBufChain): +see the TLS Look-up +Reduction Tutorial. +Note: some of the overloaded Alloc() methods specify +minimum and maximum values. See Allocation +Strategy. + +Check the return +value for errors. +The Alloc() methods return KErrNone if +the memory is available as RMBuf in the RMBufChain. + +Use the allocated +buffer (see Data Access +Example). + + +Examples

The following example requests 1,800 bytes +to the Comms pond. iAllocator is an RMBufAllocator member +of the class implementing this example.

+RMBufChain aChain; + +TInt err = chain.Alloc(1800, iAllocator); +

The following example requests 1,200 bytes and specifies a +minimum and a maximum size of 1,600 bytes. If there are no available 1,600-byte +buffers in the pond then an error is returned.

+RMBufChain chain; + +Tint err = chain.Alloc(1200, 1600, 1600, iAllocator); +
+
+Overview + +Comms Buffers +(MBuf) and Comms Chains +TLS Look-up +Reduction Tutorial +Allocation +Strategy
\ No newline at end of file