l4re-base-25.08.0

This commit is contained in:
2025-09-12 15:55:45 +02:00
commit d959eaab98
37938 changed files with 9382688 additions and 0 deletions

View File

@@ -0,0 +1,338 @@
<!-- HTML header for doxygen 1.9.1-->
<!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=9"/>
<meta name="generator" content="Doxygen 1.15.0"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>L4Re Operating System Framework: cxx::Base_slab&lt; Obj_size, Slab_size, Max_free, Alloc &gt; Class Template 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="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>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
<link href="doxygen-awesome.css" rel="stylesheet" type="text/css"/>
<link href="l4re-awesome.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 id="projectlogo"><img alt="Logo" src="L4Re_rgb_logo_quer_hg_h55.png"/></td>
<td id="projectalign" style="padding-left: 0.5em;">
<div id="projectname">L4Re Operating System Framework
</div>
<div id="projectbrief">Interface and Usage Documentation</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.15.0 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search/",'.html');
</script>
<script type="text/javascript">
$(function() { codefold.init(); });
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
$(function() {
initMenu('',true,false,'search.php','Search',true);
$(function() { init_search(); });
});
</script>
<div id="main-nav"></div>
</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('classcxx_1_1Base__slab.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">cxx::Base_slab&lt; Obj_size, Slab_size, Max_free, Alloc &gt; Class Template Reference<div class="ingroups"><a class="el" href="group__cxx__api.html">Small C++ Template Library</a></div></div></div>
</div><!--header-->
<div class="contents">
<p>Basic slab allocator.
<a href="#details">More...</a></p>
<p><code>#include &lt;<a class="el" href="slab__alloc_source.html">slab_alloc</a>&gt;</code></p>
<div id="dynsection-0" onclick="return dynsection.toggleVisibility(this)" class="dynheader closed" style="cursor:pointer;"><span class="dynarrow"><span class="arrowhead closed"></span></span>Inheritance diagram for cxx::Base_slab&lt; Obj_size, Slab_size, Max_free, Alloc &gt;:</div>
<div id="dynsection-0-summary" class="dynsummary" style="display:block;">
</div>
<div id="dynsection-0-content" class="dyncontent" style="display:none;">
<div class="center"><iframe scrolling="no" loading="lazy" frameborder="0" src="classcxx_1_1Base__slab__inherit__graph.svg" width="623" height="560"><p><b>This browser is not able to show SVG: try Firefox, Chrome, Safari, or Opera instead.</b></p></iframe></div>
</div>
<div id="dynsection-1" onclick="return dynsection.toggleVisibility(this)" class="dynheader closed" style="cursor:pointer;"><span class="dynarrow"><span class="arrowhead closed"></span></span>Collaboration diagram for cxx::Base_slab&lt; Obj_size, Slab_size, Max_free, Alloc &gt;:</div>
<div id="dynsection-1-summary" class="dynsummary" style="display:block;">
</div>
<div id="dynsection-1-content" class="dyncontent" style="display:none;">
<div class="center"><iframe scrolling="no" loading="lazy" frameborder="0" src="classcxx_1_1Base__slab__coll__graph.svg" width="163" height="166"><p><b>This browser is not able to show SVG: try Firefox, Chrome, Safari, or Opera instead.</b></p></iframe></div>
</div>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 id="header-nested-classes" class="groupheader"><a id="nested-classes" name="nested-classes"></a>
Data Structures</h2></td></tr>
<tr class="memitem:Slab_5Fi" id="r_Slab_5Fi"><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structcxx_1_1Base__slab_1_1Slab__i.html">Slab_i</a></td></tr>
<tr class="memdesc:"><td class="mdescLeft">&#160;</td><td class="mdescRight">Type of a slab. <a href="structcxx_1_1Base__slab_1_1Slab__i.html#details">More...</a><br /></td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 id="header-pub-types" class="groupheader"><a id="pub-types" name="pub-types"></a>
Public Types</h2></td></tr>
<tr class="memitem:a460703907a656943bd48296adc7883ff" id="r_a460703907a656943bd48296adc7883ff"><td class="memItemLeft" align="right" valign="top">enum &#160;</td><td class="memItemRight" valign="bottom">{ <a class="el" href="#a460703907a656943bd48296adc7883ffa7a19f42244350fe3d22c4a710f540fe8">object_size</a> = Obj_size
, <a class="el" href="#a460703907a656943bd48296adc7883ffa2481a821eaf7aaf45ce00a0ad5f52e58">slab_size</a> = Slab_size
, <a class="el" href="#a460703907a656943bd48296adc7883ffac3eaffb400ba8b32a2d0fac26174ebef">objects_per_slab</a> = (Slab_size - sizeof(Slab_head)) / object_size
, <a class="el" href="#a460703907a656943bd48296adc7883ffa02a4bdaa07af8ec9e34fedc5deb7fff5">max_free_slabs</a> = Max_free
}</td></tr>
<tr class="memitem:a1a18ed9f5accef27a92276ef4125d112" id="r_a1a18ed9f5accef27a92276ef4125d112"><td class="memItemLeft" align="right" valign="top"><a id="a1a18ed9f5accef27a92276ef4125d112" name="a1a18ed9f5accef27a92276ef4125d112"></a>
typedef Alloc&lt; <a class="el" href="structcxx_1_1Base__slab_1_1Slab__i.html">Slab_i</a> &gt;&#160;</td><td class="memItemRight" valign="bottom"><b>Slab_alloc</b></td></tr>
<tr class="memdesc:a1a18ed9f5accef27a92276ef4125d112"><td class="mdescLeft">&#160;</td><td class="mdescRight">Type of the backend allocator. <br /></td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 id="header-pub-methods" class="groupheader"><a id="pub-methods" name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr class="memitem:a5b7c524846e7cde26b2e98cf844778b7" id="r_a5b7c524846e7cde26b2e98cf844778b7"><td class="memItemLeft" align="right" valign="top">void *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#a5b7c524846e7cde26b2e98cf844778b7">alloc</a> () noexcept</td></tr>
<tr class="memdesc:a5b7c524846e7cde26b2e98cf844778b7"><td class="mdescLeft">&#160;</td><td class="mdescRight">Allocate a new object. <br /></td></tr>
<tr class="memitem:afe7c2b52fc3f56e683c28ce1e00b657c" id="r_afe7c2b52fc3f56e683c28ce1e00b657c"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#afe7c2b52fc3f56e683c28ce1e00b657c">free</a> (void *_o) noexcept</td></tr>
<tr class="memdesc:afe7c2b52fc3f56e683c28ce1e00b657c"><td class="mdescLeft">&#160;</td><td class="mdescRight">Free the given object (<span class="tt">_o</span>). <br /></td></tr>
<tr class="memitem:aaeb681ef1cc542f1e6dbf1e1c1f38efb" id="r_aaeb681ef1cc542f1e6dbf1e1c1f38efb"><td class="memItemLeft" align="right" valign="top">unsigned&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#aaeb681ef1cc542f1e6dbf1e1c1f38efb">total_objects</a> () const noexcept</td></tr>
<tr class="memdesc:aaeb681ef1cc542f1e6dbf1e1c1f38efb"><td class="mdescLeft">&#160;</td><td class="mdescRight">Get the total number of objects managed by the slab allocator. <br /></td></tr>
<tr class="memitem:a0d151a79c4781dadc59d03f635b2651e" id="r_a0d151a79c4781dadc59d03f635b2651e"><td class="memItemLeft" align="right" valign="top">unsigned&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#a0d151a79c4781dadc59d03f635b2651e">free_objects</a> () const noexcept</td></tr>
<tr class="memdesc:a0d151a79c4781dadc59d03f635b2651e"><td class="mdescLeft">&#160;</td><td class="mdescRight">Get the number of objects which can be allocated before a new empty slab needs to be added to the slab allocator. <br /></td></tr>
</table>
<a name="details" id="details"></a><h2 id="header-details" class="groupheader">Detailed Description</h2>
<div class="textblock"><div class="compoundTemplParams">template&lt;int Obj_size, int Slab_size = L4_PAGESIZE, int Max_free = 2, template&lt; typename A &gt; class Alloc = New_allocator&gt;<br />
class cxx::Base_slab&lt; Obj_size, Slab_size, Max_free, Alloc &gt;</div><p>Basic slab allocator. </p>
<dl class="tparams"><dt>Template Parameters</dt><dd>
<table class="tparams">
<tr><td class="paramname">Obj_size</td><td>The size of the objects managed by the allocator (in bytes). </td></tr>
<tr><td class="paramname">Slab_size</td><td>The size of a slab (in bytes). </td></tr>
<tr><td class="paramname">Max_free</td><td>The maximum number of free slabs. When this limit is reached slabs are freed, provided that the backend allocator supports allocated memory to be freed. </td></tr>
<tr><td class="paramname">Alloc</td><td>The backend allocator used to allocate slabs. </td></tr>
</table>
</dd>
</dl>
<p class="definition">Definition at line <a class="el" href="slab__alloc_source.html#l00031">31</a> of file <a class="el" href="slab__alloc_source.html">slab_alloc</a>.</p>
</div><a name="doc-enum-members" id="doc-enum-members"></a><h2 id="header-doc-enum-members" class="groupheader">Member Enumeration Documentation</h2>
<a id="a460703907a656943bd48296adc7883ff" name="a460703907a656943bd48296adc7883ff"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a460703907a656943bd48296adc7883ff">&#9670;&#160;</a></span>anonymous enum</h2>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;int Obj_size, int Slab_size = L4_PAGESIZE, int Max_free = 2, template&lt; typename A &gt; class Alloc = New_allocator&gt; </div>
<table class="memname">
<tr>
<td class="memname">anonymous enum</td>
</tr>
</table>
</div><div class="memdoc">
<table class="fieldtable">
<tr><th colspan="2">Enumerator</th></tr><tr><td class="fieldname"><a id="a460703907a656943bd48296adc7883ffa7a19f42244350fe3d22c4a710f540fe8" name="a460703907a656943bd48296adc7883ffa7a19f42244350fe3d22c4a710f540fe8"></a>object_size&#160;</td><td class="fielddoc"><p>Size of an object. </p>
</td></tr>
<tr><td class="fieldname"><a id="a460703907a656943bd48296adc7883ffa2481a821eaf7aaf45ce00a0ad5f52e58" name="a460703907a656943bd48296adc7883ffa2481a821eaf7aaf45ce00a0ad5f52e58"></a>slab_size&#160;</td><td class="fielddoc"><p>Size of a slab. </p>
</td></tr>
<tr><td class="fieldname"><a id="a460703907a656943bd48296adc7883ffac3eaffb400ba8b32a2d0fac26174ebef" name="a460703907a656943bd48296adc7883ffac3eaffb400ba8b32a2d0fac26174ebef"></a>objects_per_slab&#160;</td><td class="fielddoc"><p>Objects per slab. </p>
</td></tr>
<tr><td class="fieldname"><a id="a460703907a656943bd48296adc7883ffa02a4bdaa07af8ec9e34fedc5deb7fff5" name="a460703907a656943bd48296adc7883ffa02a4bdaa07af8ec9e34fedc5deb7fff5"></a>max_free_slabs&#160;</td><td class="fielddoc"><p>Maximum number of free slabs. </p>
</td></tr>
</table>
<p class="definition">Definition at line <a class="el" href="slab__alloc_source.html#l00065">65</a> of file <a class="el" href="slab__alloc_source.html">slab_alloc</a>.</p>
</div>
</div>
<a name="doc-func-members" id="doc-func-members"></a><h2 id="header-doc-func-members" class="groupheader">Member Function Documentation</h2>
<a id="a5b7c524846e7cde26b2e98cf844778b7" name="a5b7c524846e7cde26b2e98cf844778b7"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a5b7c524846e7cde26b2e98cf844778b7">&#9670;&#160;</a></span>alloc()</h2>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;int Obj_size, int Slab_size = L4_PAGESIZE, int Max_free = 2, template&lt; typename A &gt; class Alloc = New_allocator&gt; </div>
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">void * <a class="el" href="classcxx_1_1Base__slab.html">cxx::Base_slab</a>&lt; Obj_size, Slab_size, Max_free, Alloc &gt;::alloc </td>
<td>(</td>
<td class="paramname"><span class="paramname"><em></em></span></td><td>)</td>
<td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel inline">inline</span><span class="mlabel noexcept">noexcept</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Allocate a new object. </p>
<dl class="section return"><dt>Returns</dt><dd>A pointer to the new object if the allocation succeeds, or 0 on failure to acquire memory from the backend allocator when the slab cache memory is already exhausted.</dd></dl>
<dl class="section note"><dt>Note</dt><dd>The user is responsible for initializing the object. </dd></dl>
<p class="definition">Definition at line <a class="el" href="slab__alloc_source.html#l00207">207</a> of file <a class="el" href="slab__alloc_source.html">slab_alloc</a>.</p>
</div>
</div>
<a id="afe7c2b52fc3f56e683c28ce1e00b657c" name="afe7c2b52fc3f56e683c28ce1e00b657c"></a>
<h2 class="memtitle"><span class="permalink"><a href="#afe7c2b52fc3f56e683c28ce1e00b657c">&#9670;&#160;</a></span>free()</h2>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;int Obj_size, int Slab_size = L4_PAGESIZE, int Max_free = 2, template&lt; typename A &gt; class Alloc = New_allocator&gt; </div>
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">void <a class="el" href="classcxx_1_1Base__slab.html">cxx::Base_slab</a>&lt; Obj_size, Slab_size, Max_free, Alloc &gt;::free </td>
<td>(</td>
<td class="paramtype">void *</td> <td class="paramname"><span class="paramname"><em>_o</em></span></td><td>)</td>
<td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel inline">inline</span><span class="mlabel noexcept">noexcept</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Free the given object (<span class="tt">_o</span>). </p>
<dl class="section pre"><dt>Precondition</dt><dd>The object must have been allocated with this allocator. </dd></dl>
<p class="definition">Definition at line <a class="el" href="slab__alloc_source.html#l00246">246</a> of file <a class="el" href="slab__alloc_source.html">slab_alloc</a>.</p>
</div>
</div>
<a id="a0d151a79c4781dadc59d03f635b2651e" name="a0d151a79c4781dadc59d03f635b2651e"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a0d151a79c4781dadc59d03f635b2651e">&#9670;&#160;</a></span>free_objects()</h2>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;int Obj_size, int Slab_size = L4_PAGESIZE, int Max_free = 2, template&lt; typename A &gt; class Alloc = New_allocator&gt; </div>
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">unsigned <a class="el" href="classcxx_1_1Base__slab.html">cxx::Base_slab</a>&lt; Obj_size, Slab_size, Max_free, Alloc &gt;::free_objects </td>
<td>(</td>
<td class="paramname"><span class="paramname"><em></em></span></td><td>)</td>
<td> const</td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel inline">inline</span><span class="mlabel noexcept">noexcept</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Get the number of objects which can be allocated before a new empty slab needs to be added to the slab allocator. </p>
<dl class="section return"><dt>Returns</dt><dd>The number of free objects in the slab allocator. </dd></dl>
<p class="definition">Definition at line <a class="el" href="slab__alloc_source.html#l00308">308</a> of file <a class="el" href="slab__alloc_source.html">slab_alloc</a>.</p>
</div>
</div>
<a id="aaeb681ef1cc542f1e6dbf1e1c1f38efb" name="aaeb681ef1cc542f1e6dbf1e1c1f38efb"></a>
<h2 class="memtitle"><span class="permalink"><a href="#aaeb681ef1cc542f1e6dbf1e1c1f38efb">&#9670;&#160;</a></span>total_objects()</h2>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;int Obj_size, int Slab_size = L4_PAGESIZE, int Max_free = 2, template&lt; typename A &gt; class Alloc = New_allocator&gt; </div>
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">unsigned <a class="el" href="classcxx_1_1Base__slab.html">cxx::Base_slab</a>&lt; Obj_size, Slab_size, Max_free, Alloc &gt;::total_objects </td>
<td>(</td>
<td class="paramname"><span class="paramname"><em></em></span></td><td>)</td>
<td> const</td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel inline">inline</span><span class="mlabel noexcept">noexcept</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Get the total number of objects managed by the slab allocator. </p>
<dl class="section return"><dt>Returns</dt><dd>The number of objects managed by the allocator (including the free objects). </dd></dl>
<p class="definition">Definition at line <a class="el" href="slab__alloc_source.html#l00299">299</a> of file <a class="el" href="slab__alloc_source.html">slab_alloc</a>.</p>
</div>
</div>
<hr/>The documentation for this class was generated from the following file:<ul>
<li>l4/cxx/<a class="el" href="slab__alloc_source.html">slab_alloc</a></li>
</ul>
</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 -->
<!-- HTML footer for doxygen 1.9.1-->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
<ul>
<li class="navelem"><a href="namespacecxx.html">cxx</a></li><li class="navelem"><a href="classcxx_1_1Base__slab.html">Base_slab</a></li>
<li class="footer">Generated on <span class="timestamp"></span> for L4Re Operating System Framework by <a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.15.0 </li>
</ul>
</div>
</body>
</html>