home *** CD-ROM | disk | FTP | other *** search
/ IRIX Base Documentation 2001 May / SGI IRIX Base Documentation 2001 May.iso / usr / share / catman / p_man / cat3p / amalloc.z / amalloc
Encoding:
Text File  |  1998-10-20  |  24.7 KB  |  331 lines

  1.  
  2.  
  3.  
  4. AAAAMMMMAAAALLLLLLLLOOOOCCCC((((3333PPPP))))                                                        AAAAMMMMAAAALLLLLLLLOOOOCCCC((((3333PPPP))))
  5.  
  6.  
  7.  
  8. NNNNAAAAMMMMEEEE
  9.      acreate, adelete, amalloc, afree, arealloc, acalloc, amallopt,
  10.      amallinfo,arecalloc, amallocblksize, amemalign - arbitrary arena main
  11.      memory allocator
  12.  
  13. SSSSYYYYNNNNOOOOPPPPSSSSIIIISSSS
  14.      ####iiiinnnncccclllluuuuddddeeee <<<<ssssyyyyssss////ttttyyyyppppeeeessss....hhhh>>>>
  15.      ####iiiinnnncccclllluuuuddddeeee <<<<mmmmaaaalllllllloooocccc....hhhh>>>>
  16.  
  17.      _vvvv_oooo_iiii_dddd _****_aaaa_cccc_rrrr_eeee_aaaa_tttt_eeee _((((_vvvv_oooo_iiii_dddd _****_a_d_d_r_,,,, _ssss_iiii_zzzz_eeee______tttt _l_e_n_,,,, _iiii_nnnn_tttt _f_l_a_g_s_,,,,
  18.           _vvvv_oooo_iiii_dddd _****_u_s_h_d_r_,,,, _vvvv_oooo_iiii_dddd _****_((((_****_g_r_o_w_))))_((((_ssss_iiii_zzzz_eeee______tttt_,,,, _vvvv_oooo_iiii_dddd _****_))))_))))_;;;;
  19.  
  20.      _vvvv_oooo_iiii_dddd _****_aaaa_mmmm_aaaa_llll_llll_oooo_cccc _((((_ssss_iiii_zzzz_eeee______tttt _s_i_z_e_,,,, _vvvv_oooo_iiii_dddd _****_a_p_))))_;;;;
  21.  
  22.      _vvvv_oooo_iiii_dddd _aaaa_dddd_eeee_llll_eeee_tttt_eeee _((((_vvvv_oooo_iiii_dddd _****_a_p_))))_;;;;
  23.  
  24.      _vvvv_oooo_iiii_dddd _aaaa_ffff_rrrr_eeee_eeee _((((_vvvv_oooo_iiii_dddd _****_p_t_r_,,,, _vvvv_oooo_iiii_dddd _****_a_p_))))_;;;;
  25.  
  26.      _vvvv_oooo_iiii_dddd _****_aaaa_rrrr_eeee_aaaa_llll_llll_oooo_cccc _((((_vvvv_oooo_iiii_dddd _****_p_t_r_,,,, _ssss_iiii_zzzz_eeee______tttt _s_i_z_e_,,,, _vvvv_oooo_iiii_dddd _****_a_p_))))_;;;;
  27.  
  28.      _vvvv_oooo_iiii_dddd _****_aaaa_cccc_aaaa_llll_llll_oooo_cccc _((((_ssss_iiii_zzzz_eeee______tttt _n_e_l_e_m_,,,, _ssss_iiii_zzzz_eeee______tttt _e_l_s_i_z_e_,,,, _vvvv_oooo_iiii_dddd _****_a_p_))))_;;;;
  29.  
  30.      _iiii_nnnn_tttt _aaaa_mmmm_aaaa_llll_llll_oooo_pppp_tttt _((((_iiii_nnnn_tttt _c_m_d_,,,, _iiii_nnnn_tttt _v_a_l_u_e_,,,, _vvvv_oooo_iiii_dddd _****_a_p_))))_;;;;
  31.  
  32.      _ssss_tttt_rrrr_uuuu_cccc_tttt _mmmm_aaaa_llll_llll_iiii_nnnn_ffff_oooo _aaaa_mmmm_aaaa_llll_llll_iiii_nnnn_ffff_oooo _((((_vvvv_oooo_iiii_dddd _****_a_p_))))_;;;;
  33.  
  34.      _ssss_iiii_zzzz_eeee______tttt _aaaa_mmmm_aaaa_llll_llll_oooo_cccc_bbbb_llll_kkkk_ssss_iiii_zzzz_eeee _((((_vvvv_oooo_iiii_dddd _****_p_t_r_,,,, _vvvv_oooo_iiii_dddd _****_a_p_))))_;;;;
  35.  
  36.      _vvvv_oooo_iiii_dddd _****_aaaa_rrrr_eeee_cccc_aaaa_llll_llll_oooo_cccc _((((_vvvv_oooo_iiii_dddd _****_p_t_r_,,,, _ssss_iiii_zzzz_eeee______tttt _n_e_l_e_m_,,,, _ssss_iiii_zzzz_eeee______tttt _e_l_s_i_z_e_,,,,
  37.           _vvvv_oooo_iiii_dddd _****_a_p_))))_;;;;
  38.  
  39.      _vvvv_oooo_iiii_dddd _****_aaaa_mmmm_eeee_mmmm_aaaa_llll_iiii_gggg_nnnn _((((_ssss_iiii_zzzz_eeee______tttt _a_l_i_g_n_,,,, _ssss_iiii_zzzz_eeee______tttt _s_i_z_e_,,,, _vvvv_oooo_iiii_dddd _****_a_p_))))_;;;;
  40.  
  41. DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
  42.      The arena malloc package provides a main memory allocator based on the
  43.      _mmmm_aaaa_llll_llll_oooo_cccc(3X) memory allocator.  This allocator has been extended so that an
  44.      arbitrary memory space ("arena") may be set up as an area from which to
  45.      malloc.
  46.  
  47.      Calls to the arena malloc package differ from calls to the standard
  48.      _mmmm_aaaa_llll_llll_oooo_cccc(3X) only in that an arena pointer must be supplied.  This arena
  49.      pointer is returned by a call to _aaaa_cccc_rrrr_eeee_aaaa_tttt_eeee.
  50.  
  51.      _aaaa_cccc_rrrr_eeee_aaaa_tttt_eeee sets up an area defined as starting at virtual address _a_d_d_r and
  52.      extending for _l_e_n bytes.  Arenas may be either growing or non-growing and
  53.      either shared or unshared.  An arena that is non-growing is constrained
  54.      to use only up to _l_e_n bytes of memory.  The _g_r_o_w parameter should be NNNNUUUULLLLLLLL
  55.      in this case.  If the arena is growable, _l_e_n specifies the original size
  56.      (this MUST be a minimum of 1K bytes) and the _g_r_o_w parameter specifies a
  57.      function that will be called when the allocator requires more memory.
  58.      Note that the original buffer _a_d_d_r will be used only for the arena
  59.      header, the first time more memory is required, the _g_r_o_w function will be
  60.  
  61.  
  62.  
  63.                                                                         PPPPaaaaggggeeee 1111
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70. AAAAMMMMAAAALLLLLLLLOOOOCCCC((((3333PPPP))))                                                        AAAAMMMMAAAALLLLLLLLOOOOCCCC((((3333PPPP))))
  71.  
  72.  
  73.  
  74.      called.  This suggests that when setting up a growable arena a minimal
  75.      (1K) original buffer be used.  The function will be called with two
  76.      parameters, the number of bytes required and a pointer to the arena
  77.      requiring the space.  The number of bytes requested will always be a
  78.      multiple of MMMM____BBBBLLLLKKKKSSSSZZZZ (see _aaaa_mmmm_aaaa_llll_llll_oooo_pppp_tttt below).  The function should return the
  79.      address of suitably large block of memory.  This block need not be
  80.      contiguous with the original arena memory.  This block could be obtained
  81.      from a number of sources, such as by allocating a new shared memory
  82.      segment (via _ssss_hhhh_mmmm_gggg_eeee_tttt(2)); by mapping in another file (via _mmmm_mmmm_aaaa_pppp(2)); or by
  83.      calling _mmmm_aaaa_llll_llll_oooo_cccc(3X) to enlarge ones data space.  If the _g_r_o_w function
  84.      decides that it cannot provide any more space it should return _((((_vvvv_oooo_iiii_dddd_****_))))_----_1111.
  85.  
  86.      Since the allocator package involves a two-tiered allocation strategy
  87.      (small blocks and large blocks), various anomalies (such as not being
  88.      able to allocate any space!)  can arise when using very small non-
  89.      growable arenas ( _l_e_n less than 64K).  For this reason _aaaa_cccc_rrrr_eeee_aaaa_tttt_eeee will set
  90.      MMMM____BBBBLLLLKKKKSSSSZZZZ to 512 and MMMM____MMMMXXXXFFFFAAAASSSSTTTT to 0 for all arenas whose size is less than
  91.      64K and is non-growable.  These default values may be changed via
  92.      _aaaa_mmmm_aaaa_llll_llll_oooo_pppp_tttt.  Users creating very small growable arenas may likewise have to
  93.      tune the resulting arena's parameters.
  94.  
  95.      If the arena is to be shared between multiple processes, then the
  96.      MMMMEEEEMMMM____SSSSHHHHAAAARRRREEEEDDDD flag should be passed, and _u_s_h_d_r must be a pointer to a shared
  97.      arena as returned from _uuuu_ssss_iiii_nnnn_iiii_tttt(3P).  Calling _aaaa_cccc_rrrr_eeee_aaaa_tttt_eeee with the MMMMEEEEMMMM____SSSSHHHHAAAARRRREEEEDDDD
  98.      flag tells _aaaa_cccc_rrrr_eeee_aaaa_tttt_eeee to allocate a lock, which it then uses to single
  99.      thread all accesses to the arena.  It is the callers responsibility to
  100.      ensure that the arena is accessible by all processes, and to provide a
  101.      mechanism to exchange the addresses returned by _aaaa_mmmm_aaaa_llll_llll_oooo_cccc between the
  102.      various processes.
  103.  
  104.      The _MMMM_EEEE_MMMM______NNNN_OOOO_AAAA_UUUU_TTTT_OOOO_GGGG_RRRR_OOOO_WWWW flag to _aaaa_cccc_rrrr_eeee_aaaa_tttt_eeee specifies that the memory for the
  105.      arena is not going to come from a growable _mmmm_mmmm_aaaa_pppp file.  This flag only has
  106.      meaning for non-growable arenas.  The default grow function (the one that
  107.      slowly doles out up to _l_e_n bytes) attempts to make sure that the memory
  108.      being returned is in fact available.  For all but autogrow mapped files,
  109.      this is always the case - the memory was alloced somehow and by
  110.      definition is available to the user process.  Autogrow mapped files on
  111.      the other hand can fail when first accessing a new largest page due to
  112.      the file system on which the mmaped file resides being full.  In this
  113.      case, accesses to the file via a mapping result in a _SSSS_IIII_GGGG_BBBB_UUUU_SSSS signal being
  114.      sent.  To avoid giving the applications (seemingly) random _SSSS_IIII_GGGG_BBBB_UUUU_SSSS
  115.      signals, the default grow function performs a system call to validate the
  116.      memory, and if it gets a failure, returns -1 (which subsequently causes
  117.      _aaaa_mmmm_aaaa_llll_llll_oooo_cccc to return NULL).
  118.  
  119.      _aaaa_dddd_eeee_llll_eeee_tttt_eeee causes any resources allocated for the arena (e.g. semaphores) to
  120.      be freed.  Nothing is done with the arena memory itself.  No further
  121.      calls to any arena functions should be made after calling _aaaa_dddd_eeee_llll_eeee_tttt_eeee.
  122.  
  123.      _aaaa_mmmm_aaaa_llll_llll_oooo_cccc returns a pointer to a block of at least _s_i_z_e bytes suitably
  124.      aligned for any use.
  125.  
  126.  
  127.  
  128.  
  129.                                                                         PPPPaaaaggggeeee 2222
  130.  
  131.  
  132.  
  133.  
  134.  
  135.  
  136. AAAAMMMMAAAALLLLLLLLOOOOCCCC((((3333PPPP))))                                                        AAAAMMMMAAAALLLLLLLLOOOOCCCC((((3333PPPP))))
  137.  
  138.  
  139.  
  140.      The argument to _aaaa_ffff_rrrr_eeee_eeee is a pointer to a block previously allocated by
  141.      _aaaa_mmmm_aaaa_llll_llll_oooo_cccc; after _aaaa_ffff_rrrr_eeee_eeee is performed this space is made available for
  142.      further allocation, and its contents are destroyed (see _aaaa_mmmm_aaaa_llll_llll_oooo_pppp_tttt below
  143.      for a way to change this behavior).
  144.  
  145.      Undefined results will occur if the space assigned by _aaaa_mmmm_aaaa_llll_llll_oooo_cccc is overrun
  146.      or if some random number is handed to _aaaa_ffff_rrrr_eeee_eeee.  It is always permitted to
  147.      pass NULL to _aaaa_ffff_rrrr_eeee_eeee.
  148.  
  149.      _aaaa_rrrr_eeee_aaaa_llll_llll_oooo_cccc changes the size of the block pointed to by _p_t_r to _s_i_z_e bytes
  150.      and returns a pointer to the (possibly moved) block.  The contents will
  151.      be unchanged up to the lesser of the new and old sizes.  In the special
  152.      case of a null _p_t_r, _aaaa_rrrr_eeee_aaaa_llll_llll_oooo_cccc degenerates to _aaaa_mmmm_aaaa_llll_llll_oooo_cccc.  A zero _s_i_z_e causes
  153.      the passed block to be freed.
  154.  
  155.      _aaaa_cccc_aaaa_llll_llll_oooo_cccc allocates space for an array of _n_e_l_e_m elements of size _e_l_s_i_z_e.
  156.      The space is initialized to zeros.
  157.  
  158.      _aaaa_rrrr_eeee_cccc_aaaa_llll_llll_oooo_cccc combines _aaaa_rrrr_eeee_aaaa_llll_llll_oooo_cccc and _aaaa_cccc_aaaa_llll_llll_oooo_cccc.  If the size of the block
  159.      increases, any new bytes are initialized to zero.  Note that for this to
  160.      work properly, all allocations of a given pointer must go through
  161.      _aaaa_rrrr_eeee_cccc_aaaa_llll_llll_oooo_cccc.  If the original pointer was allocated with either _aaaa_mmmm_aaaa_llll_llll_oooo_cccc or
  162.      _aaaa_rrrr_eeee_aaaa_llll_llll_oooo_cccc some new bytes may not be set properly to zero.
  163.  
  164.      _aaaa_mmmm_eeee_mmmm_aaaa_llll_iiii_gggg_nnnn allocates _s_i_z_e bytes on a specified alignment boundary, and
  165.      returns a pointer to the allocated block.  The value of the returned
  166.      address is guaranteed to be an even multiple of _a_l_i_g_n.  Note: the value
  167.      of _a_l_i_g_n must be a power of two, and must be greater than or equal to the
  168.      size of a word, or, for 64 bit objects, the size of a doubleword.
  169.  
  170.      _aaaa_mmmm_aaaa_llll_llll_oooo_cccc_bbbb_llll_kkkk_ssss_iiii_zzzz_eeee returns the actual size of the block pointed to by _p_t_r.
  171.      The returned size may be greater than the original requested size due to
  172.      padding and alignment.
  173.  
  174.      _aaaa_mmmm_aaaa_llll_llll_oooo_pppp_tttt provides for control over the allocation algorithm.  The
  175.      available values for _c_m_d are:
  176.  
  177.      _MMMM______MMMM_XXXX_FFFF_AAAA_SSSS_TTTT Set _m_a_x_f_a_s_t to _v_a_l_u_e.  The algorithm allocates all blocks at or
  178.               below the size of _m_a_x_f_a_s_t in large groups and then doles them
  179.               out very quickly.  The default value for _m_a_x_f_a_s_t is 28.
  180.  
  181.      _MMMM______NNNN_LLLL_BBBB_LLLL_KKKK_SSSS Set _n_u_m_l_b_l_k_s to _v_a_l_u_e.  The above mentioned ``large groups''
  182.               each contain _n_u_m_l_b_l_k_s blocks. _n_u_m_l_b_l_k_s must be greater than 0.
  183.               The default value for _n_u_m_l_b_l_k_s is 100.
  184.  
  185.      _MMMM______GGGG_RRRR_AAAA_IIII_NNNN  Set _g_r_a_i_n to _v_a_l_u_e.  Requests less than or equal to _m_a_x_f_a_s_t will
  186.               have the size of a pointer added to them and be rounded up to
  187.               the next multiple of _g_r_a_i_n.  _v_a_l_u_e will be rounded up to a
  188.               multiple of the alignment size (16 bytes) when _g_r_a_i_n is set.
  189.               _g_r_a_i_n must be greater than 0.  The default value of _g_r_a_i_n is 16.
  190.  
  191.  
  192.  
  193.  
  194.  
  195.                                                                         PPPPaaaaggggeeee 3333
  196.  
  197.  
  198.  
  199.  
  200.  
  201.  
  202. AAAAMMMMAAAALLLLLLLLOOOOCCCC((((3333PPPP))))                                                        AAAAMMMMAAAALLLLLLLLOOOOCCCC((((3333PPPP))))
  203.  
  204.  
  205.  
  206.      _MMMM______KKKK_EEEE_EEEE_PPPP   Preserve data in a freed block until the next _aaaa_mmmm_aaaa_llll_llll_oooo_cccc, _aaaa_rrrr_eeee_aaaa_llll_llll_oooo_cccc,
  207.               or _aaaa_cccc_aaaa_llll_llll_oooo_cccc.  This option is provided only for compatibility with
  208.               the old version of _mmmm_aaaa_llll_llll_oooo_cccc and is not recommended.
  209.  
  210.      _MMMM______DDDD_EEEE_BBBB_UUUU_GGGG  Turns debug checking on if _v_a_l_u_e is not equal to 0, otherwise
  211.               turns debug checking off.  When debugging is on, each call to
  212.               _aaaa_mmmm_aaaa_llll_llll_oooo_cccc and _aaaa_ffff_rrrr_eeee_eeee causes the entire malloc arena to be scanned
  213.               and checked for consistency.  This option may be invoked at any
  214.               time.  Note that when debug checking is on, the performance of
  215.               _aaaa_mmmm_aaaa_llll_llll_oooo_cccc is reduced considerably.
  216.  
  217.      _MMMM______BBBB_LLLL_KKKK_SSSS_ZZZZ  When _aaaa_mmmm_aaaa_llll_llll_oooo_cccc requires additional space, it uses _ssss_bbbb_rrrr_kkkk(2) to
  218.               allocate enough memory for the current _aaaa_mmmm_aaaa_llll_llll_oooo_cccc request rounded
  219.               up to a minimum size (default is 8K).  The new size is set to
  220.               _v_a_l_u_e after it has been rounded up to the current block
  221.               alignment.  _v_a_l_u_e must be at least 512 bytes.  If a lot of space
  222.               is to be allocated, setting the size larger can cut down on the
  223.               system overhead.  This option may be invoked at any time.
  224.  
  225.      _MMMM______MMMM_XXXX_CCCC_HHHH_KKKK  By default, _aaaa_mmmm_aaaa_llll_llll_oooo_cccc trades off time versus space - if anywhere
  226.               in the arena there is a block of the appropriate size, _aaaa_mmmm_aaaa_llll_llll_oooo_cccc
  227.               will find and return it.  If the arena has become fragmented due
  228.               to many _aaaa_mmmm_aaaa_llll_llll_oooo_ccccs and _aaaa_ffff_rrrr_eeee_eeee_ssss, it is possible that _aaaa_mmmm_aaaa_llll_llll_oooo_cccc will
  229.               have to search through many blocks to find one of the
  230.               appropriate size.  If the arena is severely fragmented, the
  231.               average _aaaa_mmmm_aaaa_llll_llll_oooo_cccc time can be on the order of tens of milliseconds
  232.               (as opposed to a normal average of tens of microseconds).  This
  233.               option allows the user to place a limit on the number of blocks
  234.               that _aaaa_mmmm_aaaa_llll_llll_oooo_cccc will search through before allocating a new block
  235.               of space from the system.  Small values (less than 50) can cause
  236.               much more memory to be allocated.  Values around 100 (the
  237.               default) cause very uniform response time, with a small space
  238.               penalty.  This option may be invoked at any time.
  239.  
  240.      _MMMM______FFFF_RRRR_EEEE_EEEE_HHHH_DDDD When _v_a_l_u_e is not zero, _aaaa_ffff_rrrr_eeee_eeee, _aaaa_rrrr_eeee_cccc_aaaa_llll_llll_oooo_cccc, and _aaaa_rrrr_eeee_aaaa_llll_llll_oooo_cccc will
  241.               place any freed memory in the front of the free list(s) instead
  242.               of at the end (which is the default).  Some applications will
  243.               benefit in processing speed and space compaction by having freed
  244.               memory placed at the beginning of the free list(s) (a zero
  245.               _v_a_l_u_e).
  246.  
  247.      _MMMM______CCCC_LLLL_RRRR_OOOO_NNNN_FFFF_RRRR_EEEE_EEEE
  248.               With this option, all blocks that are freed are set to _v_a_l_u_e.
  249.               This option may be set at any time, but there is no way to turn
  250.               it off.  That part of the beginning of a freed block which is
  251.               used for internal pointers will of course not be set to _v_a_l_u_e.
  252.  
  253.      _MMMM______CCCC_RRRR_LLLL_OOOO_CCCC_KKKK Instructs the arena to do whatever is necessary to make it MP-
  254.               safe.  This is equivalent to passing the _MMMM_EEEE_MMMM______SSSS_HHHH_AAAA_RRRR_EEEE_DDDD option to
  255.               _aaaa_cccc_rrrr_eeee_aaaa_tttt_eeee but may be done at any time.  It is used by _uuuu_ssss_iiii_nnnn_iiii_tttt(3P)
  256.               to initialize the arena it uses to honor _uuuu_ssss_mmmm_aaaa_llll_llll_oooo_cccc calls.
  257.  
  258.  
  259.  
  260.  
  261.                                                                         PPPPaaaaggggeeee 4444
  262.  
  263.  
  264.  
  265.  
  266.  
  267.  
  268. AAAAMMMMAAAALLLLLLLLOOOOCCCC((((3333PPPP))))                                                        AAAAMMMMAAAALLLLLLLLOOOOCCCC((((3333PPPP))))
  269.  
  270.  
  271.  
  272.      These values are defined in the _<<<<_mmmm_aaaa_llll_llll_oooo_cccc_...._hhhh_>>>> header file.
  273.  
  274.      _aaaa_mmmm_aaaa_llll_llll_oooo_pppp_tttt may be called repeatedly, but, for most commands, may not be
  275.      called after the first small block is allocated.
  276.  
  277.      _aaaa_mmmm_aaaa_llll_llll_iiii_nnnn_ffff_oooo provides instrumentation describing space usage.  It returns
  278.      the structure:
  279.  
  280.      struct mallinfo  {
  281.              int arena;         /* total space in arena */
  282.              int ordblks;       /* number of ordinary blocks */
  283.              int smblks;        /* number of small blocks */
  284.              int hblkhd;        /* space in holding block headers */
  285.              int hblks;         /* number of holding blocks */
  286.              int usmblks;       /* space in small blocks in use */
  287.              int fsmblks;       /* space in free small blocks */
  288.              int uordblks;      /* space in ordinary blocks in use */
  289.              int fordblks;      /* space in free ordinary blocks */
  290.              int keepcost;      /* space penalty if keep option */
  291.                                 /* is used */
  292.      }
  293.  
  294.      This structure is defined in the _<<<<_mmmm_aaaa_llll_llll_oooo_cccc_...._hhhh_>>>> header file.  The structure
  295.      is zero until after the first space has been allocated from the arena.
  296.  
  297.      Each of the allocation routines returns a pointer to space suitably
  298.      aligned (after possible pointer coercion) for storage of any type of
  299.      object.
  300.  
  301. SSSSEEEEEEEE AAAALLLLSSSSOOOO
  302.      brk(2), malloc(3X), usinit(3P), usnewlock(3P), usmalloc(3P).
  303.  
  304. DDDDIIIIAAAAGGGGNNNNOOOOSSSSTTTTIIIICCCCSSSS
  305.      _aaaa_cccc_rrrr_eeee_aaaa_tttt_eeee will return NULL and set _eeee_rrrr_rrrr_nnnn_oooo if either _l_e_n is less than 1K or
  306.      the MMMMEEEEMMMM____SSSSHHHHAAAARRRREEEEDDDD flag is passed but _u_s_h_d_r is NNNNUUUULLLLLLLL.  _aaaa_mmmm_aaaa_llll_llll_oooo_cccc, _aaaa_rrrr_eeee_cccc_aaaa_llll_llll_oooo_cccc,
  307.      _aaaa_mmmm_eeee_mmmm_aaaa_llll_iiii_gggg_nnnn, _aaaa_rrrr_eeee_aaaa_llll_llll_oooo_cccc and _aaaa_cccc_aaaa_llll_llll_oooo_cccc return a NULL pointer if there is not
  308.      enough available memory.  On the first call to _aaaa_mmmm_aaaa_llll_llll_oooo_cccc, _aaaa_rrrr_eeee_cccc_aaaa_llll_llll_oooo_cccc,
  309.      _aaaa_rrrr_eeee_aaaa_llll_llll_oooo_cccc, or _aaaa_cccc_aaaa_llll_llll_oooo_cccc -1 may be returned and _eeee_rrrr_rrrr_nnnn_oooo set if the MMMMEEEEMMMM____SSSSHHHHAAAARRRREEEEDDDD
  310.      flag is set and it is impossible to allocate a lock.  When _aaaa_rrrr_eeee_aaaa_llll_llll_oooo_cccc or
  311.      _aaaa_rrrr_eeee_cccc_aaaa_llll_llll_oooo_cccc returns NULL, the block pointed to by _p_t_r is left intact.  If
  312.      _aaaa_mmmm_aaaa_llll_llll_oooo_pppp_tttt is called after any allocation (for most _c_m_d arguments) or if
  313.      _c_m_d or _v_a_l_u_e are invalid, non-zero is returned.  Otherwise, it returns
  314.      zero.
  315.  
  316.  
  317.  
  318.  
  319.  
  320.  
  321.  
  322.  
  323.  
  324.  
  325.  
  326.  
  327.                                                                         PPPPaaaaggggeeee 5555
  328.  
  329.  
  330.  
  331.