diff options
author | Kartik K. Agaram <vc@akkartik.com> | 2017-04-13 22:26:25 -0700 |
---|---|---|
committer | Kartik K. Agaram <vc@akkartik.com> | 2017-04-13 22:26:25 -0700 |
commit | 987b630476eff43467905299d936c388f28d3fc6 (patch) | |
tree | d9e68d0974af66bb1a195ae094dcfaf47bd1a20d /html/037abandon.cc.html | |
parent | f404eb55720ce5bcfe9e78b74933a0a2b69badef (diff) | |
download | mu-987b630476eff43467905299d936c388f28d3fc6.tar.gz |
3820
Diffstat (limited to 'html/037abandon.cc.html')
-rw-r--r-- | html/037abandon.cc.html | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/html/037abandon.cc.html b/html/037abandon.cc.html index b862337f..6ce3e661 100644 --- a/html/037abandon.cc.html +++ b/html/037abandon.cc.html @@ -81,7 +81,7 @@ if ('onhashchange' in window) { <span id="L16" class="LineNr"> 16 </span><span class="Delimiter">:(before "End Decrement Refcount(old_address, <a href='030container.cc.html#L238'>payload_type</a>, payload_size)")</span> <span id="L17" class="LineNr"> 17 </span><span class="Normal">if</span> <span class="Delimiter">(</span>old_refcount == <span class="Constant">0</span><span class="Delimiter">)</span> <span class="Delimiter">{</span> <span id="L18" class="LineNr"> 18 </span> <a href='003trace.cc.html#L161'>trace</a><span class="Delimiter">(</span><span class="Constant">9999</span><span class="Delimiter">,</span> <span class="Constant">"mem"</span><span class="Delimiter">)</span> << <span class="Constant">"automatically abandoning "</span> << old_address << <a href='003trace.cc.html#L185'>end</a><span class="Delimiter">();</span> -<span id="L19" class="LineNr"> 19 </span> <a href='037abandon.cc.html#L28'>abandon</a><span class="Delimiter">(</span>old_address<span class="Delimiter">,</span> <a href='030container.cc.html#L238'>payload_type</a><span class="Delimiter">,</span> <a href='036refcount.cc.html#L82'>payload_size</a><span class="Delimiter">);</span> +<span id="L19" class="LineNr"> 19 </span> <a href='037abandon.cc.html#L28'>abandon</a><span class="Delimiter">(</span>old_address<span class="Delimiter">,</span> <a href='030container.cc.html#L238'>payload_type</a><span class="Delimiter">,</span> <a href='036refcount.cc.html#L84'>payload_size</a><span class="Delimiter">);</span> <span id="L20" class="LineNr"> 20 </span><span class="Delimiter">}</span> <span id="L21" class="LineNr"> 21 </span> <span id="L22" class="LineNr"> 22 </span><span class="Comment">//: When abandoning addresses we'll save them to a 'free list', segregated by size.</span> @@ -90,7 +90,7 @@ if ('onhashchange' in window) { <span id="L25" class="LineNr"> 25 </span>map<<span class="Normal">int</span><span class="Delimiter">,</span> <span class="Normal">int</span>> free_list<span class="Delimiter">;</span> <span id="L26" class="LineNr"> 26 </span> <span id="L27" class="LineNr"> 27 </span><span class="Delimiter">:(code)</span> -<span id="L28" class="LineNr"> 28 </span><span class="Normal">void</span> <a href='037abandon.cc.html#L28'>abandon</a><span class="Delimiter">(</span><span class="Normal">int</span> <a href='043space.cc.html#L76'>address</a><span class="Delimiter">,</span> <span class="Normal">const</span> type_tree* <a href='030container.cc.html#L238'>payload_type</a><span class="Delimiter">,</span> <span class="Normal">int</span> <a href='036refcount.cc.html#L82'>payload_size</a><span class="Delimiter">)</span> <span class="Delimiter">{</span> +<span id="L28" class="LineNr"> 28 </span><span class="Normal">void</span> <a href='037abandon.cc.html#L28'>abandon</a><span class="Delimiter">(</span><span class="Normal">int</span> <a href='043space.cc.html#L76'>address</a><span class="Delimiter">,</span> <span class="Normal">const</span> type_tree* <a href='030container.cc.html#L238'>payload_type</a><span class="Delimiter">,</span> <span class="Normal">int</span> <a href='036refcount.cc.html#L84'>payload_size</a><span class="Delimiter">)</span> <span class="Delimiter">{</span> <span id="L29" class="LineNr"> 29 </span> <a href='003trace.cc.html#L161'>trace</a><span class="Delimiter">(</span><span class="Constant">9999</span><span class="Delimiter">,</span> <span class="Constant">"abandon"</span><span class="Delimiter">)</span> << <span class="Constant">"updating refcounts inside "</span> << <a href='043space.cc.html#L76'>address</a> << <span class="Constant">": "</span> << <a href='028call_return.cc.html#L158'>to_string</a><span class="Delimiter">(</span><a href='030container.cc.html#L238'>payload_type</a><span class="Delimiter">)</span> << <a href='003trace.cc.html#L185'>end</a><span class="Delimiter">();</span> <span id="L30" class="LineNr"> 30 </span><span class="CommentedCode">//? Total_free += size;</span> <span id="L31" class="LineNr"> 31 </span><span class="CommentedCode">//? ++Num_free;</span> @@ -104,22 +104,22 @@ if ('onhashchange' in window) { <span id="L39" class="LineNr"> 39 </span> <span class="Conceal">¦</span> <span class="Normal">int</span> element_size = size_of<span class="Delimiter">(</span>element<span class="Delimiter">);</span> <span id="L40" class="LineNr"> 40 </span> <span class="Conceal">¦</span> <span class="Normal">for</span> <span class="Delimiter">(</span><span class="Normal">int</span> i = <span class="Constant">0</span><span class="Delimiter">;</span> i < <a href='032array.cc.html#L386'>array_length</a><span class="Delimiter">;</span> ++i<span class="Delimiter">)</span> <span class="Delimiter">{</span> <span id="L41" class="LineNr"> 41 </span> <span class="Conceal">¦</span> <span class="Conceal">¦</span> element<span class="Delimiter">.</span><a href='010vm.cc.html#L65'>set_value</a><span class="Delimiter">(</span><a href='043space.cc.html#L76'>address</a> + <span class="Comment">/*</span><span class="Comment">skip refcount and length</span><span class="Comment">*/</span><span class="Constant">2</span> + i*element_size<span class="Delimiter">);</span> -<span id="L42" class="LineNr"> 42 </span> <span class="Conceal">¦</span> <span class="Conceal">¦</span> <a href='036refcount.cc.html#L51'>decrement_any_refcounts</a><span class="Delimiter">(</span>element<span class="Delimiter">);</span> +<span id="L42" class="LineNr"> 42 </span> <span class="Conceal">¦</span> <span class="Conceal">¦</span> <a href='036refcount.cc.html#L53'>decrement_any_refcounts</a><span class="Delimiter">(</span>element<span class="Delimiter">);</span> <span id="L43" class="LineNr"> 43 </span> <span class="Conceal">¦</span> <span class="Delimiter">}</span> <span id="L44" class="LineNr"> 44 </span> <span class="Delimiter">}</span> <span id="L45" class="LineNr"> 45 </span> <span class="Normal">else</span> <span class="Normal">if</span> <span class="Delimiter">(</span>is_mu_container<span class="Delimiter">(</span><a href='030container.cc.html#L238'>payload_type</a><span class="Delimiter">)</span> || is_mu_exclusive_container<span class="Delimiter">(</span><a href='030container.cc.html#L238'>payload_type</a><span class="Delimiter">))</span> <span class="Delimiter">{</span> <span id="L46" class="LineNr"> 46 </span> <span class="Conceal">¦</span> reagent tmp<span class="Delimiter">;</span> <span id="L47" class="LineNr"> 47 </span> <span class="Conceal">¦</span> tmp<span class="Delimiter">.</span>type = <span class="Normal">new</span> type_tree<span class="Delimiter">(</span>*payload_type<span class="Delimiter">);</span> <span id="L48" class="LineNr"> 48 </span> <span class="Conceal">¦</span> tmp<span class="Delimiter">.</span><a href='010vm.cc.html#L65'>set_value</a><span class="Delimiter">(</span><a href='043space.cc.html#L76'>address</a> + <span class="Comment">/*</span><span class="Comment">skip refcount</span><span class="Comment">*/</span><span class="Constant">1</span><span class="Delimiter">);</span> -<span id="L49" class="LineNr"> 49 </span> <span class="Conceal">¦</span> <a href='036refcount.cc.html#L51'>decrement_any_refcounts</a><span class="Delimiter">(</span>tmp<span class="Delimiter">);</span> +<span id="L49" class="LineNr"> 49 </span> <span class="Conceal">¦</span> <a href='036refcount.cc.html#L53'>decrement_any_refcounts</a><span class="Delimiter">(</span>tmp<span class="Delimiter">);</span> <span id="L50" class="LineNr"> 50 </span> <span class="Delimiter">}</span> <span id="L51" class="LineNr"> 51 </span> <span class="Comment">// clear memory</span> <span id="L52" class="LineNr"> 52 </span> <span class="Normal">for</span> <span class="Delimiter">(</span><span class="Normal">int</span> curr = <a href='043space.cc.html#L76'>address</a><span class="Delimiter">;</span> curr < address+payload_size<span class="Delimiter">;</span> ++curr<span class="Delimiter">)</span> <span id="L53" class="LineNr"> 53 </span> <span class="Conceal">¦</span> <a href='001help.cc.html#L218'>put</a><span class="Delimiter">(</span>Memory<span class="Delimiter">,</span> curr<span class="Delimiter">,</span> <span class="Constant">0</span><span class="Delimiter">);</span> <span id="L54" class="LineNr"> 54 </span> <span class="Comment">// append existing free list to address</span> -<span id="L55" class="LineNr"> 55 </span> <a href='003trace.cc.html#L161'>trace</a><span class="Delimiter">(</span><span class="Constant">9999</span><span class="Delimiter">,</span> <span class="Constant">"abandon"</span><span class="Delimiter">)</span> << <span class="Constant">"saving "</span> << <a href='043space.cc.html#L76'>address</a> << <span class="Constant">" in free-list of size "</span> << <a href='036refcount.cc.html#L82'>payload_size</a> << <a href='003trace.cc.html#L185'>end</a><span class="Delimiter">();</span> -<span id="L56" class="LineNr"> 56 </span> <a href='001help.cc.html#L218'>put</a><span class="Delimiter">(</span>Memory<span class="Delimiter">,</span> <a href='043space.cc.html#L76'>address</a><span class="Delimiter">,</span> <a href='001help.cc.html#L225'>get_or_insert</a><span class="Delimiter">(</span>Current_routine<span class="Delimiter">-></span>free_list<span class="Delimiter">,</span> <a href='036refcount.cc.html#L82'>payload_size</a><span class="Delimiter">));</span> -<span id="L57" class="LineNr"> 57 </span> <a href='001help.cc.html#L218'>put</a><span class="Delimiter">(</span>Current_routine<span class="Delimiter">-></span>free_list<span class="Delimiter">,</span> <a href='036refcount.cc.html#L82'>payload_size</a><span class="Delimiter">,</span> <a href='043space.cc.html#L76'>address</a><span class="Delimiter">);</span> +<span id="L55" class="LineNr"> 55 </span> <a href='003trace.cc.html#L161'>trace</a><span class="Delimiter">(</span><span class="Constant">9999</span><span class="Delimiter">,</span> <span class="Constant">"abandon"</span><span class="Delimiter">)</span> << <span class="Constant">"saving "</span> << <a href='043space.cc.html#L76'>address</a> << <span class="Constant">" in free-list of size "</span> << <a href='036refcount.cc.html#L84'>payload_size</a> << <a href='003trace.cc.html#L185'>end</a><span class="Delimiter">();</span> +<span id="L56" class="LineNr"> 56 </span> <a href='001help.cc.html#L218'>put</a><span class="Delimiter">(</span>Memory<span class="Delimiter">,</span> <a href='043space.cc.html#L76'>address</a><span class="Delimiter">,</span> <a href='001help.cc.html#L225'>get_or_insert</a><span class="Delimiter">(</span>Current_routine<span class="Delimiter">-></span>free_list<span class="Delimiter">,</span> <a href='036refcount.cc.html#L84'>payload_size</a><span class="Delimiter">));</span> +<span id="L57" class="LineNr"> 57 </span> <a href='001help.cc.html#L218'>put</a><span class="Delimiter">(</span>Current_routine<span class="Delimiter">-></span>free_list<span class="Delimiter">,</span> <a href='036refcount.cc.html#L84'>payload_size</a><span class="Delimiter">,</span> <a href='043space.cc.html#L76'>address</a><span class="Delimiter">);</span> <span id="L58" class="LineNr"> 58 </span><span class="Delimiter">}</span> <span id="L59" class="LineNr"> 59 </span> <span id="L60" class="LineNr"> 60 </span><span class="Delimiter">:(after "Allocate Special-cases")</span> |