diff options
author | Kartik K. Agaram <vc@akkartik.com> | 2016-07-05 01:08:00 -0700 |
---|---|---|
committer | Kartik K. Agaram <vc@akkartik.com> | 2016-07-05 01:08:00 -0700 |
commit | 298f8065857630e414d84e4ee785a6d17e5f99bb (patch) | |
tree | 8880a092ab59850a6f821ba892f3904ab464431c /html/037abandon.cc.html | |
parent | f28f2636c6707e1a33bebacafd0486f4965978ea (diff) | |
download | mu-298f8065857630e414d84e4ee785a6d17e5f99bb.tar.gz |
3102
Diffstat (limited to 'html/037abandon.cc.html')
-rw-r--r-- | html/037abandon.cc.html | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/html/037abandon.cc.html b/html/037abandon.cc.html index a6acff2f..661b2bb8 100644 --- a/html/037abandon.cc.html +++ b/html/037abandon.cc.html @@ -102,25 +102,20 @@ map<<span class="Normal">int</span><span class="Delimiter">,</span> <span cla put<span class="Delimiter">(</span>Current_routine<span class="Delimiter">-></span>free_list<span class="Delimiter">,</span> payload_size<span class="Delimiter">,</span> address<span class="Delimiter">);</span> <span class="Delimiter">}</span> -<span class="Delimiter">:(before "ensure_space(size)" following "case ALLOCATE")</span> +<span class="Delimiter">:(after "Allocate Special-cases")</span> <span class="Normal">if</span> <span class="Delimiter">(</span>get_or_insert<span class="Delimiter">(</span>Current_routine<span class="Delimiter">-></span>free_list<span class="Delimiter">,</span> size<span class="Delimiter">))</span> <span class="Delimiter">{</span> trace<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">"picking up space from free-list of size "</span> << size << end<span class="Delimiter">();</span> <span class="Normal">int</span> result = get_or_insert<span class="Delimiter">(</span>Current_routine<span class="Delimiter">-></span>free_list<span class="Delimiter">,</span> size<span class="Delimiter">);</span> trace<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">"new alloc from free list: "</span> << result << end<span class="Delimiter">();</span> put<span class="Delimiter">(</span>Current_routine<span class="Delimiter">-></span>free_list<span class="Delimiter">,</span> size<span class="Delimiter">,</span> get_or_insert<span class="Delimiter">(</span>Memory<span class="Delimiter">,</span> result<span class="Delimiter">));</span> - <span class="Normal">for</span> <span class="Delimiter">(</span><span class="Normal">int</span> curr = result+<span class="Constant">1</span><span class="Delimiter">;</span> curr < result+size<span class="Delimiter">;</span> ++curr<span class="Delimiter">)</span> <span class="Delimiter">{</span> + put<span class="Delimiter">(</span>Memory<span class="Delimiter">,</span> result<span class="Delimiter">,</span> <span class="Constant">0</span><span class="Delimiter">);</span> + <span class="Normal">for</span> <span class="Delimiter">(</span><span class="Normal">int</span> curr = result<span class="Delimiter">;</span> curr < result+size<span class="Delimiter">;</span> ++curr<span class="Delimiter">)</span> <span class="Delimiter">{</span> <span class="Normal">if</span> <span class="Delimiter">(</span>get_or_insert<span class="Delimiter">(</span>Memory<span class="Delimiter">,</span> curr<span class="Delimiter">)</span> != <span class="Constant">0</span><span class="Delimiter">)</span> <span class="Delimiter">{</span> raise << maybe<span class="Delimiter">(</span>current_recipe_name<span class="Delimiter">())</span> << <span class="Constant">"memory in free list was not zeroed out: "</span> << curr << <span class="Constant">'/'</span> << result << <span class="Constant">"; somebody wrote to us after free!!!</span><span class="cSpecial">\n</span><span class="Constant">"</span> << end<span class="Delimiter">();</span> <span class="Identifier">break</span><span class="Delimiter">;</span> <span class="Comment">// always fatal</span> <span class="Delimiter">}</span> <span class="Delimiter">}</span> - <span class="Normal">if</span> <span class="Delimiter">(</span>SIZE<span class="Delimiter">(</span>current_instruction<span class="Delimiter">().</span>ingredients<span class="Delimiter">)</span> > <span class="Constant">1</span><span class="Delimiter">)</span> - put<span class="Delimiter">(</span>Memory<span class="Delimiter">,</span> result+<span class="Comment">/*</span><span class="Comment">skip refcount</span><span class="Comment">*/</span><span class="Constant">1</span><span class="Delimiter">,</span> ingredients<span class="Delimiter">.</span>at<span class="Delimiter">(</span><span class="Constant">1</span><span class="Delimiter">).</span>at<span class="Delimiter">(</span><span class="Constant">0</span><span class="Delimiter">));</span> - <span class="Normal">else</span> - put<span class="Delimiter">(</span>Memory<span class="Delimiter">,</span> result<span class="Delimiter">,</span> <span class="Constant">0</span><span class="Delimiter">);</span> - products<span class="Delimiter">.</span>resize<span class="Delimiter">(</span><span class="Constant">1</span><span class="Delimiter">);</span> - products<span class="Delimiter">.</span>at<span class="Delimiter">(</span><span class="Constant">0</span><span class="Delimiter">).</span>push_back<span class="Delimiter">(</span>result<span class="Delimiter">);</span> - <span class="Identifier">break</span><span class="Delimiter">;</span> + <span class="Identifier">return</span> result<span class="Delimiter">;</span> <span class="Delimiter">}</span> <span class="Delimiter">:(scenario new_differing_size_no_reclaim)</span> |