|
1 <?xml version="1.0" encoding="utf-8"?> |
|
2 <!-- Copyright (c) 2007-2010 Nokia Corporation and/or its subsidiary(-ies) All rights reserved. --> |
|
3 <!-- This component and the accompanying materials are made available under the terms of the License |
|
4 "Eclipse Public License v1.0" which accompanies this distribution, |
|
5 and is available at the URL "http://www.eclipse.org/legal/epl-v10.html". --> |
|
6 <!-- Initial Contributors: |
|
7 Nokia Corporation - initial contribution. |
|
8 Contributors: |
|
9 --> |
|
10 <!DOCTYPE concept |
|
11 PUBLIC "-//OASIS//DTD DITA Concept//EN" "concept.dtd"> |
|
12 <concept id="GUID-9452D60C-CD3E-570D-885F-F329264AB6F4" xml:lang="en"><title>The |
|
13 array buffer</title><shortdesc>Describes the array buffer.</shortdesc><prolog><metadata><keywords/></metadata></prolog><conbody> |
|
14 <p>All arrays have an array buffer. The implementation of this buffer and |
|
15 the way it is used depend on the specific type of array.</p> |
|
16 <p>In fixed length arrays and packed arrays the elements are contained within |
|
17 the array buffer itself.</p> |
|
18 <p>In variable length arrays each element is contained within its own heap |
|
19 cell and the array buffer contains <i>pointers</i> to the elements.</p> |
|
20 <p>Logically, an array buffer is linear but, physically, it can be organised |
|
21 either as a flat buffer or a segmented buffer.</p> |
|
22 <p>In general, you can choose between array classes which use a flat array |
|
23 buffer and array classes which use a segmented array buffer. The choice depends |
|
24 on how the array is to be used.</p> |
|
25 <p>A segmented array buffer is implemented using a <codeph>CBufSeg</codeph> object.</p> |
|
26 <p>A flat array buffer is implemented either:</p> |
|
27 <ul> |
|
28 <li id="GUID-F3E43492-AE56-5290-863D-15ED57DFCC6F"><p>directly by the array |
|
29 as a piece of linear memory.</p> </li> |
|
30 </ul> |
|
31 <p>or</p> |
|
32 <ul> |
|
33 <li id="GUID-B7472961-5E2C-5ECA-864C-7B1FD547FD5F"><p>using a <codeph>CBufFlat</codeph> object.</p> </li> |
|
34 </ul> |
|
35 <p>The first has a simple and efficient implementation but has some restrictions |
|
36 on the size of an array element and is limited to holding fixed length elements. |
|
37 The second is a more general implementation but is only limited by the memory |
|
38 available.</p> |
|
39 <section id="GUID-72E6EC4A-DE51-44A9-A83D-16C3E33874E1"><title>See also</title> <p><xref href="GUID-112AAFA5-B4C9-5B62-A106-FB5097C13A0E.dita">Using |
|
40 Dynamic Buffers</xref> </p> </section> |
|
41 </conbody></concept> |