Skip to content

Commit

Permalink
chore: fix tlsfvis.html label issue (#2881)
Browse files Browse the repository at this point in the history
  • Loading branch information
HerrCai0907 authored Nov 3, 2024
1 parent 1554258 commit 15b1c30
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions lib/rtrace/tlsfvis.html
Original file line number Diff line number Diff line change
Expand Up @@ -169,16 +169,16 @@
</style>

<h1>TLSF visualizer</h1>
<p>
<strong>Notes:</strong>
<div>
<p><strong>Notes:</strong></p>
<ul>
<li>It is expected that there is exactly one block on initialization. This is the remaining space (&lt; 64K) within the last page after static data.</li>
<li>It is expected that if two adjacent blocks of size K are freed, the merged block doesn't go into the first level list for K*2 because its size is actually larger than that (K + OVERHEAD + K).</li>
<li>It is expected that if memory grows beyond 1GB, that even if all blocks are free'd there are at least two (or even three if the largest block is in the middle) remaining blocks, because a single block must not be larger than 1GB.</li>
<li>It is expected that after other operations have already been performed, being able to allocate 1GB can't be guaranteed anymore, even if there should be enough space left in absolute terms, if prior subdivision prevents it.</li>
<li>It is expected that the second level 0 in first level 0 isn't ever used due to alignment guarantees. Smallest block is 32 bytes (16 bytes overhead + 16 bytes payload if used, respectively linking information if free) in this implementation.</li>
</ul>
</p>
</div>
<p><strong>Implementation constants:</strong> <span id="albits">?</span> bits alignment, <span id="flbits">?</span> bits first level, <span id="slbits">?</span> bits second level, <span id="overhead">?</span> B overhead</p>

<h2>First level bitmap</h2>
Expand Down Expand Up @@ -229,7 +229,6 @@ <h2>Allocator</h2>
<button onclick="allocate(536870912-OVERHEAD); update()">512 MB - δ <span class="sub">fl=MSB-1 sl=MSB</span></button>
<button onclick="allocate(1073741824-OVERHEAD); update()">1 GB - δ <span class="sub">fl=MSB sl=MSB</span></button>
</p>
</p>

<h2>Segments</h2>
<p>Allocations performed above are tracked here so you can free them again. Note that TLSF alone does not keep track of used blocks (unless free'd and put in a free list again). It is expected that adjacent free blocks become merged automatically.</p>
Expand Down

0 comments on commit 15b1c30

Please sign in to comment.