Files
hdf5/develop/group___h5.html
T
2026-09-02 01:23:41 +00:00

702 lines
53 KiB
HTML

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://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=11"/>
<meta name="generator" content="Doxygen 1.16.1"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>HDF5: Library General (H5)</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="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript" src="cookie.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
$(function() { init_search(); });
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
<link href="hdf5doxy.css" rel="stylesheet" type="text/css"/>
<link href="doxygen-awesome.css" rel="stylesheet" type="text/css"/>
<link href="hdf5doxy.css" rel="stylesheet" type="text/css">
<script type="text/javascript" src="hdf5_navtree_hacks.js"></script>
<div style="background:#FFDDDD;font-size:120%;text-align:center;margin:0;padding:5px">Help us improve by taking our short survey: <a href="https://www.hdfgroup.org/website-survey/">https://www.hdfgroup.org/website-survey/</a></div>
<!-- ... other metadata & script includes ... -->
<script type="text/javascript" src="doxygen-awesome-tabs.js"></script>
<script type="text/javascript">
DoxygenAwesomeTabs.init()
</script>
<!-- Google tag (gtag.js) -->
<script async src="https://www.googletagmanager.com/gtag/js?id=G-57FMZK4S7X"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'G-57FMZK4S7X');
</script>
</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 id="projectrow">
<td id="projectlogo"><img alt="Logo" src="HDFG-logo.png"/></td>
<td id="projectalign">
<div id="projectname">HDF5<span id="projectnumber">&#160;Last Updated on 2026-09-02</span>
</div>
<div id="projectbrief">The HDF5 Field Guide</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.16.1 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search/",'.html');
</script>
<script type="text/javascript">
$(function() { codefold.init(); });
</script>
<div id="main-nav">
<div id="navrow1" class="tabs">
<ul class="tablist">
<li><a href="index.html"><span>Main&#160;Page</span></a></li>
<li><a href="_getting_started.html"><span>Getting&#160;started</span></a></li>
<li><a href="_u_g.html"><span>User&#160;Guide</span></a></li>
<li><a href="_r_m.html"><span>Reference&#160;Manual</span></a></li>
<li><a href="_cookbook.html"><span>Cookbook</span></a></li>
<li><a href="_t_n.html"><span>Technical&#160;Notes</span></a></li>
<li><a href="_r_f_c.html"><span>RFCs</span></a></li>
<li><a href="_s_p_e_c.html"><span>Specifications</span></a></li>
<li><a href="_g_l_s.html"><span>Glossary</span></a></li>
<li><a href="_f_t_s.html"><span>Full-Text&#160;Search</span></a></li>
<li><a href="_about.html"><span>About</span></a></li>
<li>
<div id="MSearchBox" class="MSearchBoxInactive">
<span class="left">
<span id="MSearchSelect" class="search-icon" onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()"><span class="search-icon-dropdown"></span></span>
<input type="text" id="MSearchField" value="" placeholder="Search" accesskey="S"
onfocus="searchBox.OnSearchFieldFocus(true)"
onblur="searchBox.OnSearchFieldFocus(false)"
onkeyup="searchBox.OnSearchFieldChange(event)"/>
</span><span class="right">
<a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><div id="MSearchCloseImg" class="close-icon"></div></a>
</span>
</div>
</li>
</ul>
</div>
</div><!-- main-nav -->
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
<div id="nav-tree">
<div id="nav-tree-contents">
<div id="nav-sync" class="sync"></div>
</div>
</div>
<div id="splitbar" style="-moz-user-select:none;"
class="ui-resizable-handle">
</div>
</div>
<script type="text/javascript">
$(function(){initNavTree('group___h5.html','',''); });
</script>
<div id="container">
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>
<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<div id="MSearchResults">
<div class="SRPage">
<div id="SRIndex">
<div id="SRResults"></div>
<div class="SRStatus" id="Loading">Loading...</div>
<div class="SRStatus" id="Searching">Searching...</div>
<div class="SRStatus" id="NoMatches">No Matches</div>
</div>
</div>
</div>
</div>
<div class="header">
<div class="headertitle"><div class="title">Library General (H5) </div></div>
</div><!--header-->
<div class="contents">
<a name="details" id="details"></a><h2 id="header-details" class="groupheader">Detailed Description</h2>
<div class="textblock"><p>Use the functions in this module to manage the life cycle of HDF5 library instances. </p>
</div><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 id="header-func-members" class="groupheader"><a id="func-members" name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:ga22628978a6ac53bee610ea5d22e48683" id="r_ga22628978a6ac53bee610ea5d22e48683"><td class="memItemLeft">void *&#160;</td><td class="memItemRight"><a class="el" href="#ga22628978a6ac53bee610ea5d22e48683">H5allocate_memory</a> (size_t size, bool clear)</td></tr>
<tr class="memdesc:ga22628978a6ac53bee610ea5d22e48683"><td class="mdescLeft">&#160;</td><td class="mdescRight">Allocates memory that will be freed later internally. <br /></td></tr>
<tr class="memitem:gade62a3e6b75bed52234d9e8432c27fb2" id="r_gade62a3e6b75bed52234d9e8432c27fb2"><td class="memItemLeft"><a class="el" href="_h5public_8h.html#a3b079ecf932a5c599499cf7e298af160">herr_t</a>&#160;</td><td class="memItemRight"><a class="el" href="#gade62a3e6b75bed52234d9e8432c27fb2">H5atclose</a> (<a class="el" href="_h5public_8h.html#a05a43aeba55b736316e74e3a26cbb254">H5_atclose_func_t</a> func, void *ctx)</td></tr>
<tr class="memdesc:gade62a3e6b75bed52234d9e8432c27fb2"><td class="mdescLeft">&#160;</td><td class="mdescRight">Registers a callback for the library to invoke when it's closing. <br /></td></tr>
<tr class="memitem:ga93525482e1168344f4c92470f99d88be" id="r_ga93525482e1168344f4c92470f99d88be"><td class="memItemLeft"><a class="el" href="_h5public_8h.html#a3b079ecf932a5c599499cf7e298af160">herr_t</a>&#160;</td><td class="memItemRight"><a class="el" href="#ga93525482e1168344f4c92470f99d88be">H5check_version</a> (unsigned majnum, unsigned minnum, unsigned relnum)</td></tr>
<tr class="memdesc:ga93525482e1168344f4c92470f99d88be"><td class="mdescLeft">&#160;</td><td class="mdescRight">Verifies that HDF5 library versions are consistent. <br /></td></tr>
<tr class="memitem:ga8a9fe81dcf66972ed75ea481e7750574" id="r_ga8a9fe81dcf66972ed75ea481e7750574"><td class="memItemLeft"><a class="el" href="_h5public_8h.html#a3b079ecf932a5c599499cf7e298af160">herr_t</a>&#160;</td><td class="memItemRight"><a class="el" href="#ga8a9fe81dcf66972ed75ea481e7750574">H5close</a> (void)</td></tr>
<tr class="memdesc:ga8a9fe81dcf66972ed75ea481e7750574"><td class="mdescLeft">&#160;</td><td class="mdescRight">Flushes all data to disk, closes all open objects, and releases memory. <br /></td></tr>
<tr class="memitem:ga7f80eb63b5e78812b9d0d50ac46764e8" id="r_ga7f80eb63b5e78812b9d0d50ac46764e8"><td class="memItemLeft"><a class="el" href="_h5public_8h.html#a3b079ecf932a5c599499cf7e298af160">herr_t</a>&#160;</td><td class="memItemRight"><a class="el" href="#ga7f80eb63b5e78812b9d0d50ac46764e8">H5dont_atexit</a> (void)</td></tr>
<tr class="memdesc:ga7f80eb63b5e78812b9d0d50ac46764e8"><td class="mdescLeft">&#160;</td><td class="mdescRight">Instructs library not to install atexit() cleanup routine. <br /></td></tr>
<tr class="memitem:ga71872bf6445cba956da86d4762b662cf" id="r_ga71872bf6445cba956da86d4762b662cf"><td class="memItemLeft"><a class="el" href="_h5public_8h.html#a3b079ecf932a5c599499cf7e298af160">herr_t</a>&#160;</td><td class="memItemRight"><a class="el" href="#ga71872bf6445cba956da86d4762b662cf">H5free_memory</a> (void *mem)</td></tr>
<tr class="memdesc:ga71872bf6445cba956da86d4762b662cf"><td class="mdescLeft">&#160;</td><td class="mdescRight">Frees memory allocated by the HDF5 library. <br /></td></tr>
<tr class="memitem:gae511943bcb837a52a012a3a5dd7b90ef" id="r_gae511943bcb837a52a012a3a5dd7b90ef"><td class="memItemLeft"><a class="el" href="_h5public_8h.html#a3b079ecf932a5c599499cf7e298af160">herr_t</a>&#160;</td><td class="memItemRight"><a class="el" href="#gae511943bcb837a52a012a3a5dd7b90ef">H5garbage_collect</a> (void)</td></tr>
<tr class="memdesc:gae511943bcb837a52a012a3a5dd7b90ef"><td class="mdescLeft">&#160;</td><td class="mdescRight">Garbage collects on all free-lists of all types. <br /></td></tr>
<tr class="memitem:ga2310d963a6f48ec12fda8c0c8bbefbbb" id="r_ga2310d963a6f48ec12fda8c0c8bbefbbb"><td class="memItemLeft"><a class="el" href="_h5public_8h.html#a3b079ecf932a5c599499cf7e298af160">herr_t</a>&#160;</td><td class="memItemRight"><a class="el" href="#ga2310d963a6f48ec12fda8c0c8bbefbbb">H5get_free_list_sizes</a> (size_t *reg_size, size_t *arr_size, size_t *blk_size, size_t *fac_size)</td></tr>
<tr class="memdesc:ga2310d963a6f48ec12fda8c0c8bbefbbb"><td class="mdescLeft">&#160;</td><td class="mdescRight">Gets the current size of the free lists used to manage memory. <br /></td></tr>
<tr class="memitem:gaf87da966fdf896ec7bca794e21d4ab0a" id="r_gaf87da966fdf896ec7bca794e21d4ab0a"><td class="memItemLeft"><a class="el" href="_h5public_8h.html#a3b079ecf932a5c599499cf7e298af160">herr_t</a>&#160;</td><td class="memItemRight"><a class="el" href="#gaf87da966fdf896ec7bca794e21d4ab0a">H5get_libversion</a> (unsigned *majnum, unsigned *minnum, unsigned *relnum)</td></tr>
<tr class="memdesc:gaf87da966fdf896ec7bca794e21d4ab0a"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns the HDF library release number. <br /></td></tr>
<tr class="memitem:gaff4f67ea7e7e366fcced7dfc3cc87b16" id="r_gaff4f67ea7e7e366fcced7dfc3cc87b16"><td class="memItemLeft"><a class="el" href="_h5public_8h.html#a3b079ecf932a5c599499cf7e298af160">herr_t</a>&#160;</td><td class="memItemRight"><a class="el" href="#gaff4f67ea7e7e366fcced7dfc3cc87b16">H5is_library_terminating</a> (bool *is_terminating)</td></tr>
<tr class="memdesc:gaff4f67ea7e7e366fcced7dfc3cc87b16"><td class="mdescLeft">&#160;</td><td class="mdescRight">Checks whether the HDF5 library is closing. <br /></td></tr>
<tr class="memitem:gaae7a734fe6c8080bff45b9142a173bc5" id="r_gaae7a734fe6c8080bff45b9142a173bc5"><td class="memItemLeft"><a class="el" href="_h5public_8h.html#a3b079ecf932a5c599499cf7e298af160">herr_t</a>&#160;</td><td class="memItemRight"><a class="el" href="#gaae7a734fe6c8080bff45b9142a173bc5">H5is_library_threadsafe</a> (bool *is_ts)</td></tr>
<tr class="memdesc:gaae7a734fe6c8080bff45b9142a173bc5"><td class="mdescLeft">&#160;</td><td class="mdescRight">Determines whether the HDF5 library was built with the thread-safety feature enabled. <br /></td></tr>
<tr class="memitem:ga27fa33dc262dda95c5aa8df533837480" id="r_ga27fa33dc262dda95c5aa8df533837480"><td class="memItemLeft"><a class="el" href="_h5public_8h.html#a3b079ecf932a5c599499cf7e298af160">herr_t</a>&#160;</td><td class="memItemRight"><a class="el" href="#ga27fa33dc262dda95c5aa8df533837480">H5open</a> (void)</td></tr>
<tr class="memdesc:ga27fa33dc262dda95c5aa8df533837480"><td class="mdescLeft">&#160;</td><td class="mdescRight">Initializes the HDF5 library. <br /></td></tr>
<tr class="memitem:gab8024266aca102414ba2960e27ddb7c2" id="r_gab8024266aca102414ba2960e27ddb7c2"><td class="memItemLeft">void *&#160;</td><td class="memItemRight"><a class="el" href="#gab8024266aca102414ba2960e27ddb7c2">H5resize_memory</a> (void *mem, size_t size)</td></tr>
<tr class="memdesc:gab8024266aca102414ba2960e27ddb7c2"><td class="mdescLeft">&#160;</td><td class="mdescRight">Resizes and, if required, re-allocates memory that will later be freed internally by the HDF5 library. <br /></td></tr>
<tr class="memitem:gaa3f78b24b8a1ff4168db2b7ddca21545" id="r_gaa3f78b24b8a1ff4168db2b7ddca21545"><td class="memItemLeft"><a class="el" href="_h5public_8h.html#a3b079ecf932a5c599499cf7e298af160">herr_t</a>&#160;</td><td class="memItemRight"><a class="el" href="#gaa3f78b24b8a1ff4168db2b7ddca21545">H5set_free_list_limits</a> (int reg_global_lim, int reg_list_lim, int arr_global_lim, int arr_list_lim, int blk_global_lim, int blk_list_lim)</td></tr>
<tr class="memdesc:gaa3f78b24b8a1ff4168db2b7ddca21545"><td class="mdescLeft">&#160;</td><td class="mdescRight">Sets free-list size limits. <br /></td></tr>
</table>
<a name="doc-func-members" id="doc-func-members"></a><h2 id="header-doc-func-members" class="groupheader">Function Documentation</h2>
<a id="ga22628978a6ac53bee610ea5d22e48683" name="ga22628978a6ac53bee610ea5d22e48683"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga22628978a6ac53bee610ea5d22e48683">&#9670;&#160;</a></span>H5allocate_memory()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void * H5allocate_memory </td>
<td>(</td>
<td class="paramtype">size_t</td> <td class="paramname"><span class="paramname"><em>size</em></span>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">bool</td> <td class="paramname"><span class="paramname"><em>clear</em></span>&#160;)</td>
</tr>
</table>
</div><div class="memdoc">
<p>Allocates memory that will be freed later internally. </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramdir">[in]</td><td class="paramname">size</td><td>The size in bytes of the buffer to be allocated </td></tr>
<tr><td class="paramdir">[in]</td><td class="paramname">clear</td><td>Flag whether the new buffer is to be initialized with 0</td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>On success, returns pointer to newly allocated buffer or returns NULL if size is 0 (zero).<br />
Returns NULL on failure.</dd></dl>
<p><a class="el" href="#ga22628978a6ac53bee610ea5d22e48683" title="Allocates memory that will be freed later internally.">H5allocate_memory()</a> allocates a memory buffer of size bytes that will later be freed internally by the HDF5 library.</p>
<p>The boolean <code class="param">clear</code> parameter specifies whether the buffer should be initialized. If clear is <code>true</code>, all bits in the buffer are to be set to 0 (zero); if clear is <code>false</code>, the buffer will not be initialized.</p>
<p>This function is intended to have the semantics of malloc() and calloc(). However, unlike malloc() and calloc(), which allow for a "special" pointer to be returned instead of NULL, this function always returns NULL on failure or when size is set to 0 (zero).</p>
<dl class="section note"><dt>Note</dt><dd>At this time, the only intended use for this function is to allocate memory that will be returned to the library as a data buffer from a third-party filter.</dd></dl>
<dl class="section attention"><dt>Attention</dt><dd>To avoid heap corruption, allocated memory should be freed using the same library that initially allocated it. In most cases, the HDF5 API uses resources that are allocated and freed either entirely by the user or entirely by the library, so this is not a problem. In rare cases, however, HDF5 API calls will free the memory that the user allocated. This function allows the user to safely allocate this memory.<br />
It is particularly important to use this function to allocate memory in Microsoft Windows environments. In Windows, the C standard library is implemented in dynamic link libraries (DLLs) known as the C run-time (CRT). Each version of Visual Studio comes with multiple versions of the CRT DLLs (debug, release, et cetera) and allocating and freeing memory across DLL boundaries can cause resource leaks and subtle bugs due to heap corruption.<br />
Even when using this function, it is best where possible to ensure that all components of a C application are built with the same version of Visual Studio and configuration (Debug or Release), and thus linked against the same CRT.<br />
Use this function only to allocate memory inside third-party HDF5 filters. It will generally not be safe to use this function to allocate memory for any other purpose.</dd></dl>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="#ga71872bf6445cba956da86d4762b662cf" title="Frees memory allocated by the HDF5 library.">H5free_memory()</a>, <a class="el" href="#gab8024266aca102414ba2960e27ddb7c2" title="Resizes and, if required, re-allocates memory that will later be freed internally by the HDF5 library...">H5resize_memory()</a></dd></dl>
<dl class="section since"><dt>Since</dt><dd>1.8.15 </dd></dl>
</div>
</div>
<a id="gade62a3e6b75bed52234d9e8432c27fb2" name="gade62a3e6b75bed52234d9e8432c27fb2"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gade62a3e6b75bed52234d9e8432c27fb2">&#9670;&#160;</a></span>H5atclose()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="_h5public_8h.html#a3b079ecf932a5c599499cf7e298af160">herr_t</a> H5atclose </td>
<td>(</td>
<td class="paramtype"><a class="el" href="_h5public_8h.html#a05a43aeba55b736316e74e3a26cbb254">H5_atclose_func_t</a></td> <td class="paramname"><span class="paramname"><em>func</em></span>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">void *</td> <td class="paramname"><span class="paramname"><em>ctx</em></span>&#160;)</td>
</tr>
</table>
</div><div class="memdoc">
<p>Registers a callback for the library to invoke when it's closing. </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramdir">[in]</td><td class="paramname">func</td><td>The function pointer to invoke </td></tr>
<tr><td class="paramdir">[in]</td><td class="paramname">ctx</td><td>Context to pass to <code class="param">func</code> when invoked </td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>Returns a non-negative value if successful; otherwise, returns a negative value.</dd></dl>
<p><a class="el" href="#gade62a3e6b75bed52234d9e8432c27fb2" title="Registers a callback for the library to invoke when it&#39;s closing.">H5atclose()</a> registers a callback that the HDF5 library will invoke when closing. The full capabilities of the HDF5 library are available to callbacks invoked through this mechanism, and library shutdown will only begin in earnest when all callbacks have been invoked and have returned.</p>
<p>Registered callbacks are invoked in LIFO order, similar to the Standard C 'atexit' routine. For example, if 'func1' is registered, then 'func2', when the library is closing 'func2', will be invoked first, then 'func1'.</p>
<p>The <code class="param">ctx</code> pointer will be passed to <code class="param">func</code> when it's invoked. NULL is allowed for <code class="param">ctx</code>.</p>
<p>If the HDF5 library is initialized and closed more than once, the <code class="param">func</code> callback must be registered within each open/close cycle.</p>
<dl class="section since"><dt>Since</dt><dd>1.14.0 </dd></dl>
</div>
</div>
<a id="ga93525482e1168344f4c92470f99d88be" name="ga93525482e1168344f4c92470f99d88be"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga93525482e1168344f4c92470f99d88be">&#9670;&#160;</a></span>H5check_version()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="_h5public_8h.html#a3b079ecf932a5c599499cf7e298af160">herr_t</a> H5check_version </td>
<td>(</td>
<td class="paramtype">unsigned</td> <td class="paramname"><span class="paramname"><em>majnum</em></span>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">unsigned</td> <td class="paramname"><span class="paramname"><em>minnum</em></span>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">unsigned</td> <td class="paramname"><span class="paramname"><em>relnum</em></span>&#160;)</td>
</tr>
</table>
</div><div class="memdoc">
<p>Verifies that HDF5 library versions are consistent. </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramdir">[in]</td><td class="paramname">majnum</td><td>HDF5 library major version number </td></tr>
<tr><td class="paramdir">[in]</td><td class="paramname">minnum</td><td>HDF5 library minor version number </td></tr>
<tr><td class="paramdir">[in]</td><td class="paramname">relnum</td><td>HDF5 library release number </td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>Returns a non-negative value if successful; otherwise, returns a negative value.</dd></dl>
<p><a class="el" href="#ga93525482e1168344f4c92470f99d88be" title="Verifies that HDF5 library versions are consistent.">H5check_version()</a> verifies that the version of the HDF5 library with which an application was compiled, as indicated by the passed parameters, matches the version of the HDF5 library against which the application is currently linked.</p>
<p><code class="param">majnum</code> is the major version number of the HDF library with which the application was compiled, <code class="param">minnum</code> is the minor version number, and <code class="param">relnum</code> is the release number. Consider the following example:</p>
<p>An official HDF5 release is labelled as follows: HDF5 Release <span class="tt">&lt;majnum&gt;.&lt;minnum&gt;.&lt;relnum&gt;</span><br />
For example, in HDF5 Release 1.8.5: </p><ul>
<li>1 is the major version number, <code class="param">majnum</code>. </li>
<li>8 is the minor version number, <code class="param">minnum</code>. </li>
<li>5 is the release number, <code class="param">relnum</code>.</li>
</ul>
<p>As stated above, <a class="el" href="#ga93525482e1168344f4c92470f99d88be" title="Verifies that HDF5 library versions are consistent.">H5check_version()</a> first verifies that the version of the HDF5 library with which an application was compiled matches the version of the HDF5 library against which the application is currently linked. If this check fails, <a class="el" href="#ga93525482e1168344f4c92470f99d88be" title="Verifies that HDF5 library versions are consistent.">H5check_version()</a> causes the application to abort (by means of a standard C abort() call) and prints information that is usually useful for debugging. This precaution is taken to avoid the risks of data corruption or segmentation faults.</p>
<p>The most common cause of this failure is that an application was compiled with one version of HDF5 and is dynamically linked with a different version different version.</p>
<p>If the above test passes, <a class="el" href="#ga93525482e1168344f4c92470f99d88be" title="Verifies that HDF5 library versions are consistent.">H5check_version()</a> proceeds to verify the consistency of additional library version information. This is designed to catch source code inconsistencies that do not normally cause failures; if this check reveals an inconsistency, an informational warning is printed but the application is allowed to run.</p>
<dl class="section since"><dt>Since</dt><dd>1.0.0 </dd></dl>
</div>
</div>
<a id="ga8a9fe81dcf66972ed75ea481e7750574" name="ga8a9fe81dcf66972ed75ea481e7750574"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga8a9fe81dcf66972ed75ea481e7750574">&#9670;&#160;</a></span>H5close()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="_h5public_8h.html#a3b079ecf932a5c599499cf7e298af160">herr_t</a> H5close </td>
<td>(</td>
<td class="paramtype">void</td> <td class="paramname"><span class="paramname"><em></em></span></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Flushes all data to disk, closes all open objects, and releases memory. </p>
<dl class="section return"><dt>Returns</dt><dd>Returns a non-negative value if successful; otherwise, returns a negative value.</dd></dl>
<p><a class="el" href="#ga8a9fe81dcf66972ed75ea481e7750574" title="Flushes all data to disk, closes all open objects, and releases memory.">H5close()</a> flushes all data to disk, closes all open HDF5 objects, and cleans up all memory used by the HDF5 library. This function is generally called when the application calls exit(), but may be called earlier in the event of an emergency shutdown or out of a desire to free all resources used by the HDF5 library.</p>
<dl class="section since"><dt>Since</dt><dd>1.0.0 </dd></dl>
</div>
</div>
<a id="ga7f80eb63b5e78812b9d0d50ac46764e8" name="ga7f80eb63b5e78812b9d0d50ac46764e8"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga7f80eb63b5e78812b9d0d50ac46764e8">&#9670;&#160;</a></span>H5dont_atexit()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="_h5public_8h.html#a3b079ecf932a5c599499cf7e298af160">herr_t</a> H5dont_atexit </td>
<td>(</td>
<td class="paramtype">void</td> <td class="paramname"><span class="paramname"><em></em></span></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Instructs library not to install atexit() cleanup routine. </p>
<dl class="section return"><dt>Returns</dt><dd>Returns a non-negative value if successful; otherwise, returns a negative value.</dd></dl>
<p><a class="el" href="#ga7f80eb63b5e78812b9d0d50ac46764e8" title="Instructs library not to install atexit() cleanup routine.">H5dont_atexit()</a> indicates to the library that an atexit() cleanup routine should not be installed. The major purpose for using this function is in situations where the library is dynamically linked into an application and is un-linked from the application before exit() gets called. In those situations, a routine installed with atexit() would jump to a routine that was no longer in memory, causing errors.</p>
<dl class="section attention"><dt>Attention</dt><dd>In order to be effective, this routine <em>must</em> be called before any other HDF5 function calls, and must be called each time the library is loaded/linked into the application (the first time and after it's been unloaded).</dd></dl>
<dl class="section since"><dt>Since</dt><dd>1.0.0 </dd></dl>
</div>
</div>
<a id="ga71872bf6445cba956da86d4762b662cf" name="ga71872bf6445cba956da86d4762b662cf"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga71872bf6445cba956da86d4762b662cf">&#9670;&#160;</a></span>H5free_memory()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="_h5public_8h.html#a3b079ecf932a5c599499cf7e298af160">herr_t</a> H5free_memory </td>
<td>(</td>
<td class="paramtype">void *</td> <td class="paramname"><span class="paramname"><em>mem</em></span></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Frees memory allocated by the HDF5 library. </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramdir">[in]</td><td class="paramname">mem</td><td>Buffer to be freed. Can be NULL </td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>Returns a non-negative value if successful; otherwise, returns a negative value.</dd></dl>
<p><a class="el" href="#ga71872bf6445cba956da86d4762b662cf" title="Frees memory allocated by the HDF5 library.">H5free_memory()</a> frees the memory that has been allocated by the caller with <a class="el" href="#ga22628978a6ac53bee610ea5d22e48683" title="Allocates memory that will be freed later internally.">H5allocate_memory()</a> or by the HDF5 library on behalf of the caller.</p>
<p><a class="el" href="group___c_o_m_p_e_n_u_m.html#ga64d1d807464d2011192f28115580fb66" title="Retrieves the name of a compound or enumeration datatype member.">H5Tget_member_name()</a> provides an example of memory allocation on behalf of the caller: The function returns a buffer containing the name of a compound datatype member. It is the caller's responsibility to eventually free that buffer with <a class="el" href="#ga71872bf6445cba956da86d4762b662cf" title="Frees memory allocated by the HDF5 library.">H5free_memory()</a>.</p>
<dl class="section attention"><dt>Attention</dt><dd>It is especially important to use this function to free memory allocated by the library on Windows. The C standard library is implemented in dynamic link libraries (DLLs) known as the C run-time (CRT). Each version of Visual Studio comes with two CRT DLLs (debug and release) and allocating and freeing across DLL boundaries can cause resource leaks and subtle bugs due to heap corruption.<br />
Only use this function to free memory allocated by the HDF5 Library. It will generally not be safe to use this function to free memory allocated by any other means.<br />
Even when using this function, it is still best to ensure that all components of a C application are built with the same version of Visual Studio and build (debug or release) and thus linked against the same CRT.</dd></dl>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="#ga22628978a6ac53bee610ea5d22e48683" title="Allocates memory that will be freed later internally.">H5allocate_memory()</a>, <a class="el" href="#gab8024266aca102414ba2960e27ddb7c2" title="Resizes and, if required, re-allocates memory that will later be freed internally by the HDF5 library...">H5resize_memory()</a></dd></dl>
<dl class="section since"><dt>Since</dt><dd>1.8.13 </dd></dl>
</div>
</div>
<a id="gae511943bcb837a52a012a3a5dd7b90ef" name="gae511943bcb837a52a012a3a5dd7b90ef"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gae511943bcb837a52a012a3a5dd7b90ef">&#9670;&#160;</a></span>H5garbage_collect()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="_h5public_8h.html#a3b079ecf932a5c599499cf7e298af160">herr_t</a> H5garbage_collect </td>
<td>(</td>
<td class="paramtype">void</td> <td class="paramname"><span class="paramname"><em></em></span></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Garbage collects on all free-lists of all types. </p>
<dl class="section return"><dt>Returns</dt><dd>Returns a non-negative value if successful; otherwise, returns a negative value.</dd></dl>
<p><a class="el" href="#gae511943bcb837a52a012a3a5dd7b90ef" title="Garbage collects on all free-lists of all types.">H5garbage_collect()</a> walks through all garbage collection routines of the library, freeing any unused memory.</p>
<p>It is not required that <a class="el" href="#gae511943bcb837a52a012a3a5dd7b90ef" title="Garbage collects on all free-lists of all types.">H5garbage_collect()</a> be called at any particular time; it is only necessary for certain situations where the application has performed actions that cause the library to allocate many objects. The application should call <a class="el" href="#gae511943bcb837a52a012a3a5dd7b90ef" title="Garbage collects on all free-lists of all types.">H5garbage_collect()</a> if it eventually releases those objects and wants to reduce the memory used by the library from the peak usage required.</p>
<dl class="section note"><dt>Note</dt><dd>The library automatically garbage collects all the free lists when the application ends.</dd></dl>
<dl class="section since"><dt>Since</dt><dd>1.4.0 </dd></dl>
</div>
</div>
<a id="ga2310d963a6f48ec12fda8c0c8bbefbbb" name="ga2310d963a6f48ec12fda8c0c8bbefbbb"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga2310d963a6f48ec12fda8c0c8bbefbbb">&#9670;&#160;</a></span>H5get_free_list_sizes()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="_h5public_8h.html#a3b079ecf932a5c599499cf7e298af160">herr_t</a> H5get_free_list_sizes </td>
<td>(</td>
<td class="paramtype">size_t *</td> <td class="paramname"><span class="paramname"><em>reg_size</em></span>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">size_t *</td> <td class="paramname"><span class="paramname"><em>arr_size</em></span>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">size_t *</td> <td class="paramname"><span class="paramname"><em>blk_size</em></span>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">size_t *</td> <td class="paramname"><span class="paramname"><em>fac_size</em></span>&#160;)</td>
</tr>
</table>
</div><div class="memdoc">
<p>Gets the current size of the free lists used to manage memory. </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramdir">[out]</td><td class="paramname">reg_size</td><td>The current size of all "regular" free list memory used </td></tr>
<tr><td class="paramdir">[out]</td><td class="paramname">arr_size</td><td>The current size of all "array" free list memory used </td></tr>
<tr><td class="paramdir">[out]</td><td class="paramname">blk_size</td><td>The current size of all "block" free list memory used </td></tr>
<tr><td class="paramdir">[out]</td><td class="paramname">fac_size</td><td>The current size of all "factory" free list memory used </td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>Returns a non-negative value if successful; otherwise, returns a negative value.</dd></dl>
<p><a class="el" href="#ga2310d963a6f48ec12fda8c0c8bbefbbb" title="Gets the current size of the free lists used to manage memory.">H5get_free_list_sizes()</a> obtains the current size of the different kinds of free lists that the library uses to manage memory. The free list sizes can be set with <a class="el" href="#gaa3f78b24b8a1ff4168db2b7ddca21545" title="Sets free-list size limits.">H5set_free_list_limits()</a> and garbage collected with <a class="el" href="#gae511943bcb837a52a012a3a5dd7b90ef" title="Garbage collects on all free-lists of all types.">H5garbage_collect()</a>. These lists are global for the entire library.</p>
<dl class="section since"><dt>Since</dt><dd>1.10.7 </dd></dl>
</div>
</div>
<a id="gaf87da966fdf896ec7bca794e21d4ab0a" name="gaf87da966fdf896ec7bca794e21d4ab0a"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gaf87da966fdf896ec7bca794e21d4ab0a">&#9670;&#160;</a></span>H5get_libversion()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="_h5public_8h.html#a3b079ecf932a5c599499cf7e298af160">herr_t</a> H5get_libversion </td>
<td>(</td>
<td class="paramtype">unsigned *</td> <td class="paramname"><span class="paramname"><em>majnum</em></span>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">unsigned *</td> <td class="paramname"><span class="paramname"><em>minnum</em></span>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">unsigned *</td> <td class="paramname"><span class="paramname"><em>relnum</em></span>&#160;)</td>
</tr>
</table>
</div><div class="memdoc">
<p>Returns the HDF library release number. </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramdir">[out]</td><td class="paramname">majnum</td><td>The major version number of the library </td></tr>
<tr><td class="paramdir">[out]</td><td class="paramname">minnum</td><td>The minor version number of the library </td></tr>
<tr><td class="paramdir">[out]</td><td class="paramname">relnum</td><td>The release version number of the library </td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>Returns a non-negative value if successful; otherwise, returns a negative value.</dd></dl>
<p><a class="el" href="#gaf87da966fdf896ec7bca794e21d4ab0a" title="Returns the HDF library release number.">H5get_libversion()</a> retrieves the major, minor, and release numbers of the version of the HDF5 library which is linked to the application.</p>
<dl class="section since"><dt>Since</dt><dd>1.0.0 </dd></dl>
</div>
</div>
<a id="gaff4f67ea7e7e366fcced7dfc3cc87b16" name="gaff4f67ea7e7e366fcced7dfc3cc87b16"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gaff4f67ea7e7e366fcced7dfc3cc87b16">&#9670;&#160;</a></span>H5is_library_terminating()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="_h5public_8h.html#a3b079ecf932a5c599499cf7e298af160">herr_t</a> H5is_library_terminating </td>
<td>(</td>
<td class="paramtype">bool *</td> <td class="paramname"><span class="paramname"><em>is_terminating</em></span></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Checks whether the HDF5 library is closing. </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramdir">[out]</td><td class="paramname">is_terminating</td><td>Flag indicating whether library is shutting down </td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>Returns a non-negative value if successful; otherwise, returns a negative value.</dd></dl>
<p><a class="el" href="#gaff4f67ea7e7e366fcced7dfc3cc87b16" title="Checks whether the HDF5 library is closing.">H5is_library_terminating()</a> queries whether the HDF5 library is in the process of shutting down. The <code class="param">is_terminating</code> flag will only be set to true after shutdown starts, it will be false before the library has been initialized, while the library is initialized, and after it has been closed. The value of <code class="param">is_terminating</code> is undefined if this routine fails.</p>
<dl class="section since"><dt>Since</dt><dd>1.14.0 </dd></dl>
</div>
</div>
<a id="gaae7a734fe6c8080bff45b9142a173bc5" name="gaae7a734fe6c8080bff45b9142a173bc5"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gaae7a734fe6c8080bff45b9142a173bc5">&#9670;&#160;</a></span>H5is_library_threadsafe()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="_h5public_8h.html#a3b079ecf932a5c599499cf7e298af160">herr_t</a> H5is_library_threadsafe </td>
<td>(</td>
<td class="paramtype">bool *</td> <td class="paramname"><span class="paramname"><em>is_ts</em></span></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Determines whether the HDF5 library was built with the thread-safety feature enabled. </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramdir">[out]</td><td class="paramname">is_ts</td><td>Boolean value indicating whether the library was built with thread-safety enabled </td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>Returns a non-negative value if successful; otherwise, returns a negative value.</dd></dl>
<p>The HDF5 library, although not internally multi-threaded, can be built with a thread-safety feature enabled that protects internal data structures with a mutex. In certain circumstances, it may be useful to determine, at run-time, whether the linked HDF5 library was built with the thread-safety feature enabled.</p>
<dl class="section since"><dt>Since</dt><dd>1.10.0 </dd></dl>
</div>
</div>
<a id="ga27fa33dc262dda95c5aa8df533837480" name="ga27fa33dc262dda95c5aa8df533837480"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga27fa33dc262dda95c5aa8df533837480">&#9670;&#160;</a></span>H5open()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="_h5public_8h.html#a3b079ecf932a5c599499cf7e298af160">herr_t</a> H5open </td>
<td>(</td>
<td class="paramtype">void</td> <td class="paramname"><span class="paramname"><em></em></span></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Initializes the HDF5 library. </p>
<dl class="section return"><dt>Returns</dt><dd>Returns a non-negative value if successful; otherwise, returns a negative value.</dd></dl>
<p><a class="el" href="#ga27fa33dc262dda95c5aa8df533837480" title="Initializes the HDF5 library.">H5open()</a> initializes the HDF5 library.</p>
<p>When the HDF5 library is used in a C application, the library is automatically initialized when the first HDF5 function call is issued. If one finds that an HDF5 library function is failing inexplicably, <a class="el" href="#ga27fa33dc262dda95c5aa8df533837480" title="Initializes the HDF5 library.">H5open()</a> can be called first. It is safe to call <a class="el" href="#ga27fa33dc262dda95c5aa8df533837480" title="Initializes the HDF5 library.">H5open()</a> before an application issues any other function calls to the HDF5 library, as there are no damaging side effects in calling it more than once.</p>
<dl class="section since"><dt>Since</dt><dd>1.0.0 </dd></dl>
</div>
</div>
<a id="gab8024266aca102414ba2960e27ddb7c2" name="gab8024266aca102414ba2960e27ddb7c2"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gab8024266aca102414ba2960e27ddb7c2">&#9670;&#160;</a></span>H5resize_memory()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void * H5resize_memory </td>
<td>(</td>
<td class="paramtype">void *</td> <td class="paramname"><span class="paramname"><em>mem</em></span>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">size_t</td> <td class="paramname"><span class="paramname"><em>size</em></span>&#160;)</td>
</tr>
</table>
</div><div class="memdoc">
<p>Resizes and, if required, re-allocates memory that will later be freed internally by the HDF5 library. </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramdir">[in]</td><td class="paramname">mem</td><td>Pointer to a buffer to be resized. May be NULL </td></tr>
<tr><td class="paramdir">[in]</td><td class="paramname">size</td><td>New size of the buffer, in bytes</td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>On success, returns pointer to resized or reallocated buffer or returns NULL if size is 0 (zero).<br />
Returns NULL on failure.</dd></dl>
<p><a class="el" href="#gab8024266aca102414ba2960e27ddb7c2" title="Resizes and, if required, re-allocates memory that will later be freed internally by the HDF5 library...">H5resize_memory()</a> takes a pointer to an existing buffer and resizes the buffer to match the value in <code class="param">size</code>. If necessary, the buffer is reallocated. If <code class="param">size</code> is 0, the buffer is released.</p>
<p>The input buffer must either be NULL or have been allocated by <a class="el" href="#ga22628978a6ac53bee610ea5d22e48683" title="Allocates memory that will be freed later internally.">H5allocate_memory()</a> since the input buffer may be freed by the library.</p>
<p>For certain behaviors, the pointer <code class="param">mem</code> may be passed in as NULL.</p>
<p>This function is intended to have the semantics of realloc():</p>
<table class="doxtable">
<tr>
<td><span class="tt">H5resize_memory(buffer, size)</span></td><td>Resizes buffer. Returns pointer to resized buffer.</td></tr>
<tr>
<td><span class="tt">H5resize_memory(NULL, size)</span></td><td>Allocates memory using HDF5 Library allocator. Returns pointer to new buffer</td></tr>
<tr>
<td><span class="tt">H5resize_memory(buffer, 0)</span></td><td>Frees memory using HDF5 Library allocator. Returns NULL.</td></tr>
<tr>
<td><span class="tt">H5resize_memory(NULL, 0)</span></td><td>Returns NULL (undefined in C standard).</td></tr>
</table>
<p>Unlike realloc(), which allows for a "special pointer to be returned instead of NULL, this function always returns NULL on failure or when size is 0 (zero).</p>
<dl class="section note"><dt>Note</dt><dd>At this time, the only intended use for this function is to resize or reallocate memory that will be returned to the library (and eventually to the user) as a data buffer from a third-party HDF5 filter.</dd></dl>
<dl class="section attention"><dt>Attention</dt><dd>To avoid heap corruption, allocated memory should be freed using the same library that initially allocated it. In most cases, the HDF5 API uses resources that are allocated and freed either entirely by the user or entirely by the library, so this is not a problem. In rare cases, however, HDF5 API calls will free memory that the user allocated. This function allows the user to safely allocate this memory.<br />
It is particularly important to use this function to resize memory on Microsoft Windows systems. In Windows, the C standard library is implemented in dynamic link libraries (DLLs) known as the C run-time (CRT). Each version of Visual Studio comes with multiple versions of the CRT DLLs (debug, release, et cetera) and allocating and freeing memory across DLL boundaries can cause resource leaks and subtle bugs due to heap corruption.<br />
Even when using this function, it is still best to ensure that all components of a C application are built with the same version of Visual Studio and the same configuration (Debug or Release), and thus linked against the same CRT.<br />
Only use this function to resize memory inside third-party HDF5 filters. It will generally not be safe to use this function to resize memory for any other purpose.</dd></dl>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="#ga22628978a6ac53bee610ea5d22e48683" title="Allocates memory that will be freed later internally.">H5allocate_memory()</a>, <a class="el" href="#ga71872bf6445cba956da86d4762b662cf" title="Frees memory allocated by the HDF5 library.">H5free_memory()</a></dd></dl>
<dl class="section since"><dt>Since</dt><dd>1.8.15 </dd></dl>
</div>
</div>
<a id="gaa3f78b24b8a1ff4168db2b7ddca21545" name="gaa3f78b24b8a1ff4168db2b7ddca21545"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gaa3f78b24b8a1ff4168db2b7ddca21545">&#9670;&#160;</a></span>H5set_free_list_limits()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="_h5public_8h.html#a3b079ecf932a5c599499cf7e298af160">herr_t</a> H5set_free_list_limits </td>
<td>(</td>
<td class="paramtype">int</td> <td class="paramname"><span class="paramname"><em>reg_global_lim</em></span>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">int</td> <td class="paramname"><span class="paramname"><em>reg_list_lim</em></span>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">int</td> <td class="paramname"><span class="paramname"><em>arr_global_lim</em></span>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">int</td> <td class="paramname"><span class="paramname"><em>arr_list_lim</em></span>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">int</td> <td class="paramname"><span class="paramname"><em>blk_global_lim</em></span>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">int</td> <td class="paramname"><span class="paramname"><em>blk_list_lim</em></span>&#160;)</td>
</tr>
</table>
</div><div class="memdoc">
<p>Sets free-list size limits. </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramdir">[in]</td><td class="paramname">reg_global_lim</td><td>The cumulative limit, in bytes, on memory used for all regular free lists (Default: 1MB) </td></tr>
<tr><td class="paramdir">[in]</td><td class="paramname">reg_list_lim</td><td>The limit, in bytes, on memory used for each regular free list (Default: 64KB) </td></tr>
<tr><td class="paramdir">[in]</td><td class="paramname">arr_global_lim</td><td>The cumulative limit, in bytes, on memory used for all array free lists (Default: 4MB) </td></tr>
<tr><td class="paramdir">[in]</td><td class="paramname">arr_list_lim</td><td>The limit, in bytes, on memory used for each array free list (Default: 256KB) </td></tr>
<tr><td class="paramdir">[in]</td><td class="paramname">blk_global_lim</td><td>The cumulative limit, in bytes, on memory used for all block free lists and, separately, for all factory free lists (Default: 16MB) </td></tr>
<tr><td class="paramdir">[in]</td><td class="paramname">blk_list_lim</td><td>The limit, in bytes, on memory used for each block or factory free list (Default: 1MB) </td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>Returns a non-negative value if successful; otherwise, returns a negative value.</dd></dl>
<p><a class="el" href="#gaa3f78b24b8a1ff4168db2b7ddca21545" title="Sets free-list size limits.">H5set_free_list_limits()</a> sets size limits on all types of free lists. The HDF5 library uses free lists internally to manage memory. The types of free lists used are as follows: </p><ul>
<li>Regular free lists manage memory for single internal data structures. </li>
<li>Array free lists manage memory for arrays of internal data structures. </li>
<li>Block free lists manage memory for arbitrarily-sized blocks of bytes. </li>
<li>Factory free lists manage memory for fixed-size blocks of bytes.</li>
</ul>
<p>The parameters specify global and per-list limits; for example, <code class="param">reg_global_limit</code> and <code class="param">reg_list_limit</code> limit the accumulated size of all regular free lists and the size of each individual regular free list, respectively. Therefore, if an application sets a 1Mb limit on each of the global lists, up to 4Mb of total storage might be allocated, 1Mb for each of the regular, array, block, and factory type lists.</p>
<p>The settings specified for block free lists are duplicated for factory free lists. Therefore, increasing the global limit on block free lists by x bytes will increase the potential free list memory usage by 2x bytes.</p>
<p>Using a value of -1 for a limit means that no limit is set for the specified type of free list.</p>
<dl class="section version"><dt>Version</dt><dd>1.8.3 Function changed in this release to set factory free list memory limits.</dd></dl>
<dl class="section since"><dt>Since</dt><dd>1.4.0 </dd></dl>
</div>
</div>
</div><!-- contents -->
</div><!-- doc-content -->
<div id="page-nav" class="page-nav-panel">
<div id="page-nav-resize-handle"></div>
<div id="page-nav-tree">
<div id="page-nav-contents">
</div><!-- page-nav-contents -->
</div><!-- page-nav-tree -->
</div><!-- page-nav -->
</div><!-- container -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
<ul>
<li class="footer">Generated by <a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.16.1 </li>
</ul>
</div>
</body>
</html>