]> Gitweb @ Texas Instruments - Open Source Git Repositories - git.TI.com/gitweb - processor-sdk/performance-audio-sr.git/blobdiff - psdk_cust/ipc_3_43_00_00_eng/docs/cdoc/ti/sdo/ipc/heaps/HeapMultiBufMP-src.html
Removed IPC and PDK from psdk_cust folder.
[processor-sdk/performance-audio-sr.git] / psdk_cust / ipc_3_43_00_00_eng / docs / cdoc / ti / sdo / ipc / heaps / HeapMultiBufMP-src.html
diff --git a/psdk_cust/ipc_3_43_00_00_eng/docs/cdoc/ti/sdo/ipc/heaps/HeapMultiBufMP-src.html b/psdk_cust/ipc_3_43_00_00_eng/docs/cdoc/ti/sdo/ipc/heaps/HeapMultiBufMP-src.html
deleted file mode 100644 (file)
index 474c38d..0000000
+++ /dev/null
@@ -1,425 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
-<html><head><title>module ti.sdo.ipc.heaps.HeapMultiBufMP</title>
-<meta name="googlebot" content="noindex,nofollow">
-<link rel="stylesheet" type="text/css" href="../../../../src.css"/>
-</head>
-<body>
-<pre class=src>
-     1    <span class="comment">/*
-</span>     2    <span class="comment"> * Copyright (c) 2012-2013, Texas Instruments Incorporated
-</span>     3    <span class="comment"> * All rights reserved.
-</span>     4    <span class="comment"> *
-</span>     5    <span class="comment"> * Redistribution and use in source and binary forms, with or without
-</span>     6    <span class="comment"> * modification, are permitted provided that the following conditions
-</span>     7    <span class="comment"> * are met:
-</span>     8    <span class="comment"> *
-</span>     9    <span class="comment"> * *  Redistributions of source code must retain the above copyright
-</span>    10    <span class="comment"> *    notice, this list of conditions and the following disclaimer.
-</span>    11    <span class="comment"> *
-</span>    12    <span class="comment"> * *  Redistributions in binary form must reproduce the above copyright
-</span>    13    <span class="comment"> *    notice, this list of conditions and the following disclaimer in the
-</span>    14    <span class="comment"> *    documentation and/or other materials provided with the distribution.
-</span>    15    <span class="comment"> *
-</span>    16    <span class="comment"> * *  Neither the name of Texas Instruments Incorporated nor the names of
-</span>    17    <span class="comment"> *    its contributors may be used to endorse or promote products derived
-</span>    18    <span class="comment"> *    from this software without specific prior written permission.
-</span>    19    <span class="comment"> *
-</span>    20    <span class="comment"> * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
-</span>    21    <span class="comment"> * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
-</span>    22    <span class="comment"> * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
-</span>    23    <span class="comment"> * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
-</span>    24    <span class="comment"> * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-</span>    25    <span class="comment"> * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-</span>    26    <span class="comment"> * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
-</span>    27    <span class="comment"> * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
-</span>    28    <span class="comment"> * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
-</span>    29    <span class="comment"> * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
-</span>    30    <span class="comment"> * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-</span>    31    <span class="comment"> */</span>
-    32    <span class="comment">/*
-</span>    33    <span class="comment"> *  ======== HeapMultiBufMP.xdc ========
-</span>    34    <span class="comment"> *
-</span>    35    <span class="comment"> *
-</span>    36    <span class="comment"> */</span>
-    37    
-    38    <span class=key>package</span> ti.sdo.ipc.heaps;
-    39    
-    40    import ti.sdo.ipc.SharedRegion;
-    41    import ti.sdo.ipc.Ipc;
-    42    import ti.sdo.ipc.GateMP;
-    43    import ti.sdo.utils.NameServer;
-    44    
-    45    import xdc.rov.ViewInfo;    <span class="comment">/* Display local/shared state + FreeBlockView */</span>
-    46    
-    47    import xdc.runtime.Error;
-    48    import xdc.runtime.Assert;
-    49    import xdc.runtime.Memory;
-    50    import xdc.runtime.Startup;
-    51    
-    52    <span class="xdoc">/*!
-</span>    53    <span class="xdoc"> *  ======== HeapMultiBufMP ========
-</span>    54    <span class="xdoc"> *  Multi-processor fixed-size buffer heap implementation
-</span>    55    <span class="xdoc"> *
-</span>    56    <span class="xdoc"> *  <b>@p(html)</b>
-</span>    57    <span class="xdoc"> *  This module has a common header that can be found in the {<b>@link</b> ti.ipc}
-</span>    58    <span class="xdoc"> *  package.  Application code should include the common header file (not the
-</span>    59    <span class="xdoc"> *  RTSC-generated one):
-</span>    60    <span class="xdoc"> *
-</span>    61    <span class="xdoc"> *  &lt;PRE&gt;#include &amp;lt;ti/ipc/HeapMultiBufMP.h&amp;gt;&lt;/PRE&gt;
-</span>    62    <span class="xdoc"> *
-</span>    63    <span class="xdoc"> *  The RTSC module must be used in the application's RTSC configuration file
-</span>    64    <span class="xdoc"> *  (.cfg) if runtime APIs will be used in the application:
-</span>    65    <span class="xdoc"> *
-</span>    66    <span class="xdoc"> *  &lt;PRE&gt;HeapMultiBufMP = xdc.useModule('ti.sdo.ipc.heaps.HeapMultiBufMP');
-</span>    67    <span class="xdoc"> *  &lt;/PRE&gt;
-</span>    68    <span class="xdoc"> *
-</span>    69    <span class="xdoc"> *  Documentation for all runtime APIs, instance configuration parameters,
-</span>    70    <span class="xdoc"> *  error codes macros and type definitions available to the application
-</span>    71    <span class="xdoc"> *  integrator can be found in the
-</span>    72    <span class="xdoc"> *  &lt;A HREF="../../../../../doxygen/html/files.html"&gt;Doxygen documenation&lt;/A&gt;
-</span>    73    <span class="xdoc"> *  for the IPC product.  However, the documentation presented on this page
-</span>    74    <span class="xdoc"> *  should be referred to for information specific to the RTSC module, such as
-</span>    75    <span class="xdoc"> *  module configuration, Errors, and Asserts.
-</span>    76    <span class="xdoc"> *  <b>@p</b>
-</span>    77    <span class="xdoc"> *
-</span>    78    <span class="xdoc"> *  It is important to note that max allocation tracking is disabled by default
-</span>    79    <span class="xdoc"> *  in {<b>@link</b> #trackMaxAllocs}.  Disabling allocation tracking improves alloc/
-</span>    80    <span class="xdoc"> *  free performance especially when cache calls are required in shared memory.
-</span>    81    <span class="xdoc"> */</span>
-    82    @InstanceInitError
-    83    @InstanceFinalize
-    84    
-    85    <span class=key>module</span> HeapMultiBufMP <span class=key>inherits</span> xdc.runtime.IHeap
-    86    {
-    87        <span class="xdoc">/*! <b>@_nodoc</b> */</span>
-    88        <span class=key>metaonly</span> <span class=key>struct</span> BasicView {
-    89            String          name;
-    90            Ptr             buf;
-    91            Memory.Size     totalSize;
-    92            String          objType;
-    93            Ptr             gate;
-    94            Bool            exact;
-    95        }
-    96    
-    97        <span class="xdoc">/*! <b>@_nodoc</b> */</span>
-    98        <span class=key>metaonly</span> <span class=key>struct</span> BucketsView {
-    99            Ptr             baseAddr;
-   100            UInt            blockSize;
-   101            UInt            align;
-   102            UInt            numBlocks;
-   103            UInt            numFreeBlocks;
-   104            UInt            minFreeBlocks;
-   105        }
-   106    
-   107        <span class="xdoc">/*! <b>@_nodoc</b> */</span>
-   108        @Facet
-   109        <span class=key>metaonly</span> <span class=key>config</span> ViewInfo.Instance rovViewInfo =
-   110            ViewInfo.create({
-   111                viewMap: [
-   112                [
-   113                    <span class="string">'Basic'</span>,
-   114                    {
-   115                        type: ViewInfo.INSTANCE,
-   116                        viewInitFxn: <span class="string">'viewInitBasic'</span>,
-   117                        structName: <span class="string">'BasicView'</span>
-   118                    }
-   119                ],
-   120                [
-   121                    <span class="string">'Buffer Information'</span>,
-   122                    {
-   123                        type: ViewInfo.INSTANCE_DATA,
-   124                        viewInitFxn: <span class="string">'viewInitData'</span>,
-   125                        structName: <span class="string">'BucketsView'</span>
-   126                    }
-   127                ],
-   128                ]
-   129            });
-   130    
-   131        <span class="xdoc">/*!
-</span>   132    <span class="xdoc">     *  Structure for bucket configuration
-</span>   133    <span class="xdoc">     *
-</span>   134    <span class="xdoc">     *  An array of buckets is a required parameter to create any
-</span>   135    <span class="xdoc">     *  HeapMultiBufMP instance.  The fields of each bucket correspond
-</span>   136    <span class="xdoc">     *  to the attributes of each buffer in the HeapMultiBufMP.  The actual
-</span>   137    <span class="xdoc">     *  block sizes and alignments may be adjusted per the process described
-</span>   138    <span class="xdoc">     *  at {<b>@link</b> #bucketEntries}.
-</span>   139    <span class="xdoc">     *
-</span>   140    <span class="xdoc">     *  <b>@field(blockSize)</b>       Size of each block (in MADUs)
-</span>   141    <span class="xdoc">     *  <b>@field(numBlocks)</b>       Number of blocks
-</span>   142    <span class="xdoc">     *  <b>@field(align)</b>           Alignment of each block (in MADUs)
-</span>   143    <span class="xdoc">     */</span>
-   144        <span class=key>struct</span> Bucket {
-   145            SizeT       blockSize;
-   146            UInt        numBlocks;
-   147            SizeT       align;
-   148        }
-   149    
-   150        <span class="xdoc">/*!
-</span>   151    <span class="xdoc">     *  ======== ExtendedStats ========
-</span>   152    <span class="xdoc">     *  Stats structure for the getExtendedStats API.
-</span>   153    <span class="xdoc">     *
-</span>   154    <span class="xdoc">     *  <b>@field(numBuckets)</b>         Number of buckets
-</span>   155    <span class="xdoc">     *  <b>@field(numBlocks)</b>          Number of blocks in each buffer
-</span>   156    <span class="xdoc">     *  <b>@field(blockSize)</b>          Block size of each buffer
-</span>   157    <span class="xdoc">     *  <b>@field(align)</b>              Alignment of each buffer
-</span>   158    <span class="xdoc">     *  <b>@field(maxAllocatedBlocks)</b> The maximum number of blocks allocated from
-</span>   159    <span class="xdoc">     *                             this heap at any single point in time during
-</span>   160    <span class="xdoc">     *                             the lifetime of this HeapMultiBufMP instance
-</span>   161    <span class="xdoc">     *
-</span>   162    <span class="xdoc">     *  <b>@field(numAllocatedBlocks)</b> The total number of blocks currently
-</span>   163    <span class="xdoc">     *                             allocated in this HeapMultiBufMP instance
-</span>   164    <span class="xdoc">     */</span>
-   165        <span class=key>struct</span> ExtendedStats {
-   166            UInt numBuckets;
-   167            UInt numBlocks          [8];
-   168            UInt blockSize          [8];
-   169            UInt align              [8];
-   170            UInt maxAllocatedBlocks [8];
-   171            UInt numAllocatedBlocks [8];
-   172        }
-   173    
-   174        <span class="xdoc">/*!
-</span>   175    <span class="xdoc">     *  Assert raised when the align parameter is not a power of 2.
-</span>   176    <span class="xdoc">     */</span>
-   177        <span class=key>config</span> Assert.Id A_invalidAlign =
-   178            {msg: <span class="string">"align parameter must be a power of 2"</span>};
-   179    
-   180        <span class="xdoc">/*!
-</span>   181    <span class="xdoc">     *  Assert raised when an invalid buffer size was passed to free()
-</span>   182    <span class="xdoc">     */</span>
-   183        <span class=key>config</span> Assert.Id A_sizeNotFound =
-   184            {msg: <span class="string">"an invalid buffer size was passed to free"</span>};
-   185    
-   186        <span class="xdoc">/*!
-</span>   187    <span class="xdoc">     *  Assert raised when an invalid block address was passed to free()
-</span>   188    <span class="xdoc">     */</span>
-   189        <span class=key>config</span> Assert.Id A_addrNotFound =
-   190            {msg: <span class="string">"an invalid buffer address was passed to free"</span>};
-   191    
-   192        <span class="xdoc">/*!
-</span>   193    <span class="xdoc">     *  Error raised when exact matching failed
-</span>   194    <span class="xdoc">     */</span>
-   195        <span class=key>config</span> Error.Id E_exactFail =
-   196            {msg: <span class="string">"E_exactFail: Exact allocation failed (requested size = %u and buffer size = %u)"</span>};
-   197    
-   198        <span class="xdoc">/*!
-</span>   199    <span class="xdoc">     *  Error raised when requested size exceeds all blockSizes.
-</span>   200    <span class="xdoc">     */</span>
-   201        <span class=key>config</span> Error.Id E_size =
-   202            {msg: <span class="string">"E_size: requested size/alignment is too big (requested size = %u and requested align = %u)"</span>};
-   203    
-   204        <span class="xdoc">/*!
-</span>   205    <span class="xdoc">     *  Error raised when there are no blocks left in the buffer corresponding to the requested size/alignment
-</span>   206    <span class="xdoc">     */</span>
-   207        <span class=key>config</span> Error.Id E_noBlocksLeft =
-   208            {msg: <span class="string">"E_noBlocksLeft: No more blocks left in buffer (buffer size = %u and buffer align = %u)"</span>};
-   209    
-   210        <span class="xdoc">/*!
-</span>   211    <span class="xdoc">     *  Maximum runtime entries
-</span>   212    <span class="xdoc">     *
-</span>   213    <span class="xdoc">     *  Maximum number of HeapMultiBufMP's that can be dynamically created and
-</span>   214    <span class="xdoc">     *  added to the NameServer.
-</span>   215    <span class="xdoc">     *
-</span>   216    <span class="xdoc">     *  To minimize the amount of runtime allocation, this parameter allows
-</span>   217    <span class="xdoc">     *  the pre-allocation of memory for the HeapMultiBufMP's NameServer table.
-</span>   218    <span class="xdoc">     *  The default is to allow growth (i.e. memory allocation when
-</span>   219    <span class="xdoc">     *  creating a new instance).
-</span>   220    <span class="xdoc">     */</span>
-   221        <span class=key>metaonly</span> <span class=key>config</span> UInt maxRuntimeEntries = NameServer.ALLOWGROWTH;
-   222    
-   223        <span class="xdoc">/*!
-</span>   224    <span class="xdoc">     *  Maximum length for heap names
-</span>   225    <span class="xdoc">     */</span>
-   226        <span class=key>config</span> UInt maxNameLen = 32;
-   227    
-   228        <span class="xdoc">/*!
-</span>   229    <span class="xdoc">     *  Section name is used to place the names table
-</span>   230    <span class="xdoc">     *
-</span>   231    <span class="xdoc">     *  The default value of NULL implies that no explicit placement is
-</span>   232    <span class="xdoc">     *  performed.
-</span>   233    <span class="xdoc">     */</span>
-   234        <span class=key>metaonly</span> <span class=key>config</span> String tableSection = <span class=key>null</span>;
-   235    
-   236        <span class="xdoc">/*!
-</span>   237    <span class="xdoc">     *  Track the maximum number of allocated blocks
-</span>   238    <span class="xdoc">     *
-</span>   239    <span class="xdoc">     *  This will enable/disable the tracking of the maximum number of
-</span>   240    <span class="xdoc">     *  allocations for a HeapMultiBufMP instance.  This maximum refers to the
-</span>   241    <span class="xdoc">     *  "all time" maximum number of allocations for the history of a
-</span>   242    <span class="xdoc">     *  HeapMultiBufMP instance, not the current number of allocations.
-</span>   243    <span class="xdoc">     *
-</span>   244    <span class="xdoc">     *  Tracking the maximum might adversely affect performance when allocating
-</span>   245    <span class="xdoc">     *  and/or freeing. If this feature is not needed, setting this to false
-</span>   246    <span class="xdoc">     *  avoids the performance penalty.
-</span>   247    <span class="xdoc">     */</span>
-   248        <span class=key>config</span> Bool trackMaxAllocs = <span class=key>false</span>;
-   249    
-   250    <span class=key>instance</span>:
-   251    
-   252        <span class="xdoc">/*!
-</span>   253    <span class="xdoc">     *  GateMP used for critical region management of the shared memory
-</span>   254    <span class="xdoc">     *
-</span>   255    <span class="xdoc">     *  Using the default value of NULL will result in use of the GateMP
-</span>   256    <span class="xdoc">     *  system gate for context protection.
-</span>   257    <span class="xdoc">     */</span>
-   258        <span class=key>config</span> GateMP.Handle gate = <span class=key>null</span>;
-   259    
-   260        <span class="xdoc">/*! <b>@_nodoc</b>
-</span>   261    <span class="xdoc">     *   by the open() call. No one else should touch this!
-</span>   262    <span class="xdoc">     */</span>
-   263        <span class=key>config</span> Bool openFlag = <span class=key>false</span>;
-   264    
-   265        <span class="xdoc">/*!
-</span>   266    <span class="xdoc">     *  Use exact matching
-</span>   267    <span class="xdoc">     *
-</span>   268    <span class="xdoc">     *  Setting this flag will allow allocation only if the requested size
-</span>   269    <span class="xdoc">     *  is equal to (rather than less than or equal to) a buffer's block size.
-</span>   270    <span class="xdoc">     */</span>
-   271        <span class=key>config</span> Bool exact = <span class=key>false</span>;
-   272    
-   273        <span class="xdoc">/*!
-</span>   274    <span class="xdoc">     *  Name of this instance.
-</span>   275    <span class="xdoc">     *
-</span>   276    <span class="xdoc">     *  The name (if not NULL) must be unique among all HeapMultiBufMP
-</span>   277    <span class="xdoc">     *  instances in the entire system.  When creating a new
-</span>   278    <span class="xdoc">     *  heap, it is necessary to supply an instance name.
-</span>   279    <span class="xdoc">     */</span>
-   280        <span class=key>config</span> String name = <span class=key>null</span>;
-   281    
-   282        <span class="xdoc">/*!
-</span>   283    <span class="xdoc">     *  Number of buckets in {<b>@link</b> #bucketEntries}
-</span>   284    <span class="xdoc">     *
-</span>   285    <span class="xdoc">     *  This parameter is required to create any instance.
-</span>   286    <span class="xdoc">     */</span>
-   287        <span class=key>config</span> Int numBuckets = 0;
-   288    
-   289        <span class="xdoc">/*!
-</span>   290    <span class="xdoc">     *  Bucket Entries
-</span>   291    <span class="xdoc">     *
-</span>   292    <span class="xdoc">     *  The bucket entries are an array of {<b>@link</b> #Bucket}s whose values
-</span>   293    <span class="xdoc">     *  correspond to the desired alignment, block size and length for each
-</span>   294    <span class="xdoc">     *  buffer.  It is important to note that the alignments and sizes for each
-</span>   295    <span class="xdoc">     *  buffer may be adjusted due to cache and alignment related constraints.
-</span>   296    <span class="xdoc">     *  Buffer sizes are rounded up by their corresponding alignments.  Buffer
-</span>   297    <span class="xdoc">     *  alignments themselves will assume the value of region cache alignment
-</span>   298    <span class="xdoc">     *  size when the cache size is greater than the requested buffer alignment.
-</span>   299    <span class="xdoc">     *
-</span>   300    <span class="xdoc">     *  For example, specifying a bucket with {blockSize: 192, align: 256} will
-</span>   301    <span class="xdoc">     *  result in a buffer of blockSize = 256 and alignment = 256.  If cache
-</span>   302    <span class="xdoc">     *  alignment is required, then a bucket of {blockSize: 96, align: 64} will
-</span>   303    <span class="xdoc">     *  result in a buffer of blockSize = 128 and alignment = 128 (assuming
-</span>   304    <span class="xdoc">     *  cacheSize = 128).
-</span>   305    <span class="xdoc">     */</span>
-   306        <span class=key>config</span> Bucket bucketEntries[];
-   307    
-   308        <span class="xdoc">/*!
-</span>   309    <span class="xdoc">     *  Shared region ID
-</span>   310    <span class="xdoc">     *
-</span>   311    <span class="xdoc">     *  The index corresponding to the shared region from which shared memory
-</span>   312    <span class="xdoc">     *  will be allocated.
-</span>   313    <span class="xdoc">     */</span>
-   314        <span class=key>config</span> UInt16 regionId = 0;
-   315    
-   316        <span class="xdoc">/*! <b>@_nodoc</b>
-</span>   317    <span class="xdoc">     *  Physical address of the shared memory
-</span>   318    <span class="xdoc">     *
-</span>   319    <span class="xdoc">     *  This value can be left as 'null' unless it is required to place the
-</span>   320    <span class="xdoc">     *  heap at a specific location in shared memory.  If sharedAddr is null,
-</span>   321    <span class="xdoc">     *  then shared memory for a new instance will be allocated from the
-</span>   322    <span class="xdoc">     *  heap belonging to the region identified by {<b>@link</b> #regionId}.
-</span>   323    <span class="xdoc">     */</span>
-   324        <span class=key>config</span> Ptr sharedAddr = <span class=key>null</span>;
-   325    
-   326        @DirectCall
-   327        <span class=key>override</span> Ptr alloc(SizeT size, SizeT align, xdc.runtime.Error.Block *eb);
-   328    
-   329        @DirectCall
-   330        <span class=key>override</span> Void free(Ptr block, SizeT size);
-   331    
-   332    <span class=key>internal</span>:
-   333    
-   334        <span class="xdoc">/*! Used in the attrs-&gt;status field */</span>
-   335        <span class=key>const</span> UInt32 CREATED = 0x05101920;
-   336    
-   337        <span class="xdoc">/*!
-</span>   338    <span class="xdoc">     *  This Params object is used for temporary storage of the
-</span>   339    <span class="xdoc">     *  module wide parameters that are for setting the NameServer instance.
-</span>   340    <span class="xdoc">     */</span>
-   341        <span class=key>metaonly</span> <span class=key>config</span> NameServer.Params nameSrvPrms;
-   342    
-   343        <span class="xdoc">/*! slice and dice the buffer */</span>
-   344        Void postInit(Object *obj, Error.Block *eb);
-   345    
-   346        <span class="xdoc">/*!
-</span>   347    <span class="xdoc">     * Takes in modifiable array of bucket entries, performs an in-place sort
-</span>   348    <span class="xdoc">     * of the bucket entries, combines the entries as necessary, and returns
-</span>   349    <span class="xdoc">     * the new number of buckets in the combined entries
-</span>   350    <span class="xdoc">     */</span>
-   351        UInt processBuckets(Bucket *bucketEntries, Params *params,
-   352                            UInt16 regionId);
-   353    
-   354        <span class="xdoc">/*!
-</span>   355    <span class="xdoc">     * Add the block to the tail; index specifies the buffer number
-</span>   356    <span class="xdoc">     *
-</span>   357    <span class="xdoc">     * Precondition: inv obj-&gt;attrs-&gt;bucket[index]
-</span>   358    <span class="xdoc">     * Postcondition: wb obj-&gt;attrs-&gt;bucket[index] and wb the block
-</span>   359    <span class="xdoc">     */</span>
-   360        Void putTail(Object *obj, Int index, Elem *block);
-   361    
-   362        <span class="xdoc">/*!
-</span>   363    <span class="xdoc">     * Removes a block from the head and returns it; index specifies
-</span>   364    <span class="xdoc">     * the buffer number. The block is invalidated before returned
-</span>   365    <span class="xdoc">     *
-</span>   366    <span class="xdoc">     * Precondition: inv obj-&gt;attrs-&gt;bucket[index]
-</span>   367    <span class="xdoc">     * Postcondition: wb obj-&gt;attrs-&gt;bucket[index]
-</span>   368    <span class="xdoc">     */</span>
-   369        Elem *getHead(Object *obj, Int index);
-   370    
-   371        <span class="xdoc">/*! Needed for freelist */</span>
-   372        @Opaque <span class=key>struct</span> Elem {
-   373            <span class="comment">/* must be volatile for whole_program */</span>
-   374            volatile SharedRegion.SRPtr next;
-   375        };
-   376    
-   377        <span class="xdoc">/*! Shared memory state for a single buffer. */</span>
-   378        <span class=key>struct</span> BucketAttrs {
-   379            SharedRegion.SRPtr  head;
-   380            SharedRegion.SRPtr  tail;
-   381            SharedRegion.SRPtr  baseAddr;
-   382            Bits32              numFreeBlocks;
-   383            Bits32              minFreeBlocks;
-   384            Bits32              blockSize;
-   385            Bits32              align;
-   386            Bits32              numBlocks;
-   387        }
-   388    
-   389        <span class="xdoc">/*! Shared memory state for a HeapMultiBufMP instance */</span>
-   390        <span class=key>struct</span> Attrs {
-   391            Bits32              status;         <span class="comment">/* Created stamp                 */</span>
-   392            SharedRegion.SRPtr  gateMPAddr;     <span class="comment">/* GateMP SRPtr                  */</span>
-   393            Bits32              numBuckets;     <span class="comment">/* Number of buffers             */</span>
-   394            BucketAttrs         buckets[8]; <span class="comment">/* Buffer attributes        */</span>
-   395            Bits16              exact;          <span class="comment">/* 1 = exact matching, 0 = no    */</span>
-   396        }
-   397    
-   398        <span class=key>struct</span> Instance_State {
-   399            Attrs               *attrs;         <span class="comment">/* Shared state                  */</span>
-   400            GateMP.Handle       gate;           <span class="comment">/* Gate for critical regions     */</span>
-   401            Ipc.ObjType         objType;        <span class="comment">/* See enum ObjType              */</span>
-   402            Ptr                 nsKey;          <span class="comment">/* Used to remove NS entry       */</span>
-   403            Bool                cacheEnabled;   <span class="comment">/* Whether to do cache calls     */</span>
-   404            UInt16              regionId;       <span class="comment">/* SharedRegion index            */</span>
-   405            SizeT               allocSize;      <span class="comment">/* Shared memory allocated       */</span>
-   406            Char                *buf;           <span class="comment">/* Local pointer to buf          */</span>
-   407            Bucket              bucketEntries[];<span class="comment">/* Optimized bucketEntries       */</span>
-   408                                                <span class="comment">/* NULL for dynamic instance     */</span>
-   409            UInt                numBuckets;     <span class="comment">/* # of optimized entries        */</span>
-   410            Bool                exact;          <span class="comment">/* Exact match flag              */</span>
-   411        };
-   412    
-   413        <span class=key>struct</span> Module_State {
-   414            NameServer.Handle   nameServer;
-   415        };
-   416    }
-</pre>
-</body></html>