This file is indexed.

/usr/share/doc/liblzma-doc/html/structlzma__allocator.html is in liblzma-doc 5.1.1alpha+20120614-2ubuntu2.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.6"/>
<title>XZ Utils: lzma_allocator Struct Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td style="padding-left: 0.5em;">
   <div id="projectname">XZ Utils
   &#160;<span id="projectnumber">5.1.0alpha</span>
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.6 -->
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="pages.html"><span>Related&#160;Pages</span></a></li>
      <li class="current"><a href="annotated.html"><span>Data&#160;Structures</span></a></li>
      <li><a href="files.html"><span>Files</span></a></li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="annotated.html"><span>Data&#160;Structures</span></a></li>
      <li><a href="functions.html"><span>Data&#160;Fields</span></a></li>
    </ul>
  </div>
</div><!-- top -->
<div class="header">
  <div class="summary">
<a href="#pub-attribs">Data Fields</a>  </div>
  <div class="headertitle">
<div class="title">lzma_allocator Struct Reference</div>  </div>
</div><!--header-->
<div class="contents">

<p>Custom functions for memory handling.  
 <a href="structlzma__allocator.html#details">More...</a></p>

<p><code>#include &lt;base.h&gt;</code></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-attribs"></a>
Data Fields</h2></td></tr>
<tr class="memitem:a6a6d5ef7d5f1a55ce5bbca51e432ea3f"><td class="memItemLeft" align="right" valign="top">void *(*&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structlzma__allocator.html#a6a6d5ef7d5f1a55ce5bbca51e432ea3f">alloc</a> )(void *<a class="el" href="structlzma__allocator.html#aab293a5007a93299cc97ee8b5fb81268">opaque</a>, size_t nmemb, size_t size)</td></tr>
<tr class="memdesc:a6a6d5ef7d5f1a55ce5bbca51e432ea3f"><td class="mdescLeft">&#160;</td><td class="mdescRight">Pointer to a custom memory allocation function.  <a href="#a6a6d5ef7d5f1a55ce5bbca51e432ea3f">More...</a><br/></td></tr>
<tr class="separator:a6a6d5ef7d5f1a55ce5bbca51e432ea3f"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a4fe2dc8c939119a3ecdfee14a47c3de2"><td class="memItemLeft" align="right" valign="top">void(*&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structlzma__allocator.html#a4fe2dc8c939119a3ecdfee14a47c3de2">free</a> )(void *<a class="el" href="structlzma__allocator.html#aab293a5007a93299cc97ee8b5fb81268">opaque</a>, void *ptr)</td></tr>
<tr class="memdesc:a4fe2dc8c939119a3ecdfee14a47c3de2"><td class="mdescLeft">&#160;</td><td class="mdescRight">Pointer to a custom memory freeing function.  <a href="#a4fe2dc8c939119a3ecdfee14a47c3de2">More...</a><br/></td></tr>
<tr class="separator:a4fe2dc8c939119a3ecdfee14a47c3de2"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aab293a5007a93299cc97ee8b5fb81268"><td class="memItemLeft" align="right" valign="top">void *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structlzma__allocator.html#aab293a5007a93299cc97ee8b5fb81268">opaque</a></td></tr>
<tr class="memdesc:aab293a5007a93299cc97ee8b5fb81268"><td class="mdescLeft">&#160;</td><td class="mdescRight">Pointer passed to .<a class="el" href="structlzma__allocator.html#a6a6d5ef7d5f1a55ce5bbca51e432ea3f" title="Pointer to a custom memory allocation function. ">alloc()</a> and .<a class="el" href="structlzma__allocator.html#a4fe2dc8c939119a3ecdfee14a47c3de2" title="Pointer to a custom memory freeing function. ">free()</a>  <a href="#aab293a5007a93299cc97ee8b5fb81268">More...</a><br/></td></tr>
<tr class="separator:aab293a5007a93299cc97ee8b5fb81268"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p>Custom functions for memory handling. </p>
<p>A pointer to <a class="el" href="structlzma__allocator.html" title="Custom functions for memory handling. ">lzma_allocator</a> may be passed via <a class="el" href="structlzma__stream.html" title="Passing data to and from liblzma. ">lzma_stream</a> structure to liblzma, and some advanced functions take a pointer to <a class="el" href="structlzma__allocator.html" title="Custom functions for memory handling. ">lzma_allocator</a> as a separate function argument. The library will use the functions specified in <a class="el" href="structlzma__allocator.html" title="Custom functions for memory handling. ">lzma_allocator</a> for memory handling instead of the default malloc() and <a class="el" href="structlzma__allocator.html#a4fe2dc8c939119a3ecdfee14a47c3de2" title="Pointer to a custom memory freeing function. ">free()</a>. C++ users should note that the custom memory handling functions must not throw exceptions.</p>
<p>Single-threaded mode only: liblzma doesn't make an internal copy of <a class="el" href="structlzma__allocator.html" title="Custom functions for memory handling. ">lzma_allocator</a>. Thus, it is OK to change these function pointers in the middle of the coding process, but obviously it must be done carefully to make sure that the replacement `free' can deallocate memory allocated by the earlier `alloc' function(s).</p>
<p>Multithreaded mode: liblzma might internally store pointers to the <a class="el" href="structlzma__allocator.html" title="Custom functions for memory handling. ">lzma_allocator</a> given via the <a class="el" href="structlzma__stream.html" title="Passing data to and from liblzma. ">lzma_stream</a> structure. The application must not change the allocator pointer in <a class="el" href="structlzma__stream.html" title="Passing data to and from liblzma. ">lzma_stream</a> or the contents of the pointed <a class="el" href="structlzma__allocator.html" title="Custom functions for memory handling. ">lzma_allocator</a> structure until <a class="el" href="base_8h.html#a854ff37464ae1225febf14db1af43308" title="Free memory allocated for the coder data structures. ">lzma_end()</a> has been used to free the memory associated with that <a class="el" href="structlzma__stream.html" title="Passing data to and from liblzma. ">lzma_stream</a>. The allocation functions might be called simultaneously from multiple threads, and thus they must be thread safe. </p>
</div><h2 class="groupheader">Field Documentation</h2>
<a class="anchor" id="a6a6d5ef7d5f1a55ce5bbca51e432ea3f"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void*( * lzma_allocator::alloc)(void *<a class="el" href="structlzma__allocator.html#aab293a5007a93299cc97ee8b5fb81268">opaque</a>, size_t nmemb, size_t size)</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Pointer to a custom memory allocation function. </p>
<p>If you don't want a custom allocator, but still want custom <a class="el" href="structlzma__allocator.html#a4fe2dc8c939119a3ecdfee14a47c3de2" title="Pointer to a custom memory freeing function. ">free()</a>, set this to NULL and liblzma will use the standard malloc().</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">opaque</td><td><a class="el" href="structlzma__allocator.html#aab293a5007a93299cc97ee8b5fb81268" title="Pointer passed to .alloc() and .free() ">lzma_allocator.opaque</a> (see below) </td></tr>
    <tr><td class="paramname">nmemb</td><td>Number of elements like in calloc(). liblzma will always set nmemb to 1, so it is safe to ignore nmemb in a custom allocator if you like. The nmemb argument exists only for compatibility with zlib and libbzip2. </td></tr>
    <tr><td class="paramname">size</td><td>Size of an element in bytes. liblzma never sets this to zero.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>Pointer to the beginning of a memory block of `size' bytes, or NULL if allocation fails for some reason. When allocation fails, functions of liblzma return LZMA_MEM_ERROR.</dd></dl>
<p>The allocator should not waste time zeroing the allocated buffers. This is not only about speed, but also memory usage, since the operating system kernel doesn't necessarily allocate the requested memory in physical memory until it is actually used. With small input files, liblzma may actually need only a fraction of the memory that it requested for allocation.</p>
<dl class="section note"><dt>Note</dt><dd>LZMA_MEM_ERROR is also used when the size of the allocation would be greater than SIZE_MAX. Thus, don't assume that the custom allocator must have returned NULL if some function from liblzma returns LZMA_MEM_ERROR. </dd></dl>

</div>
</div>
<a class="anchor" id="a4fe2dc8c939119a3ecdfee14a47c3de2"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void( * lzma_allocator::free)(void *<a class="el" href="structlzma__allocator.html#aab293a5007a93299cc97ee8b5fb81268">opaque</a>, void *ptr)</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Pointer to a custom memory freeing function. </p>
<p>If you don't want a custom freeing function, but still want a custom allocator, set this to NULL and liblzma will use the standard <a class="el" href="structlzma__allocator.html#a4fe2dc8c939119a3ecdfee14a47c3de2" title="Pointer to a custom memory freeing function. ">free()</a>.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">opaque</td><td><a class="el" href="structlzma__allocator.html#aab293a5007a93299cc97ee8b5fb81268" title="Pointer passed to .alloc() and .free() ">lzma_allocator.opaque</a> (see below) </td></tr>
    <tr><td class="paramname">ptr</td><td>Pointer returned by <a class="el" href="structlzma__allocator.html#a6a6d5ef7d5f1a55ce5bbca51e432ea3f" title="Pointer to a custom memory allocation function. ">lzma_allocator.alloc()</a>, or when it is set to NULL, a pointer returned by the standard malloc(). </td></tr>
  </table>
  </dd>
</dl>

<p>Referenced by <a class="el" href="common_8h.html#a11940cc6553c7274d0cc313bebd00e6a">lzma_free()</a>.</p>

</div>
</div>
<a class="anchor" id="aab293a5007a93299cc97ee8b5fb81268"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void* lzma_allocator::opaque</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Pointer passed to .<a class="el" href="structlzma__allocator.html#a6a6d5ef7d5f1a55ce5bbca51e432ea3f" title="Pointer to a custom memory allocation function. ">alloc()</a> and .<a class="el" href="structlzma__allocator.html#a4fe2dc8c939119a3ecdfee14a47c3de2" title="Pointer to a custom memory freeing function. ">free()</a> </p>
<p>opaque is passed as the first argument to <a class="el" href="structlzma__allocator.html#a6a6d5ef7d5f1a55ce5bbca51e432ea3f" title="Pointer to a custom memory allocation function. ">lzma_allocator.alloc()</a> and <a class="el" href="structlzma__allocator.html#a4fe2dc8c939119a3ecdfee14a47c3de2" title="Pointer to a custom memory freeing function. ">lzma_allocator.free()</a>. This intended to ease implementing custom memory allocation functions for use with liblzma.</p>
<p>If you don't need this, you should set this to NULL. </p>

<p>Referenced by <a class="el" href="common_8h.html#a11940cc6553c7274d0cc313bebd00e6a">lzma_free()</a>.</p>

</div>
</div>
<hr/>The documentation for this struct was generated from the following file:<ul>
<li>liblzma/api/lzma/<a class="el" href="base_8h.html">base.h</a></li>
</ul>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated on Wed Feb 12 2014 15:12:38 for XZ Utils by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.6
</small></address>
</body>
</html>