Skip to content

Commit

Permalink
Fixed issues with slides 13 and 17.
Browse files Browse the repository at this point in the history
  • Loading branch information
toddATavail committed Nov 3, 2023
1 parent 962fcd1 commit aa11412
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -263,9 +263,9 @@ <h1>MEMORY SAFETY</h1>
<!-- Double free in C. -->
<section>
<pre><code class="language-cpp" data-trim data-line-numbers data-noescape>
int* x = (int*) malloc(sizeof(some_struct)); // Allocate
free(x); // Single free - good
free(x); // Double free - bad
int* x = (int*) malloc(sizeof(int)); // Allocate
free(x); // Single free - good
free(x); // Double free - bad
</code></pre>
<p>C loves double free &mdash; no error 🤦</p>
</section>
Expand Down Expand Up @@ -377,7 +377,7 @@ <h1>MEMORY SAFETY</h1>
<p>Rules of borrowing:</p>
<ul>
<li class="fragment">
<em class="rust">Either</em> there may be <span class="rust">one</span> mutable burrow</li>
<em class="rust">Either</em> there may be <span class="rust">one</span> mutable borrow</li>
<li class="fragment">
<em class="rust">Or</em> there may be <span class="rust">zero</span> or <span class="rust">many</span>
immutable borrows
Expand Down

0 comments on commit aa11412

Please sign in to comment.