diff options
author | Kartik K. Agaram <vc@akkartik.com> | 2016-11-11 15:54:19 -0800 |
---|---|---|
committer | Kartik K. Agaram <vc@akkartik.com> | 2016-11-11 15:54:19 -0800 |
commit | 6d007fda037331e7761d2a9ed3a2e435131daf7e (patch) | |
tree | 656aa7fe284b2b11c01f0389fe81f1b31025ce4e /html/074deep_copy.cc.html | |
parent | c9f920da6e6b3e7049f078fea35e08256cae7c5b (diff) | |
download | mu-6d007fda037331e7761d2a9ed3a2e435131daf7e.tar.gz |
3667
Diffstat (limited to 'html/074deep_copy.cc.html')
-rw-r--r-- | html/074deep_copy.cc.html | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/html/074deep_copy.cc.html b/html/074deep_copy.cc.html index a4bc1c10..7d6570dd 100644 --- a/html/074deep_copy.cc.html +++ b/html/074deep_copy.cc.html @@ -254,7 +254,7 @@ put<span class="Delimiter">(</span>Recipe_ordinal<span class="Delimiter">,</span products<span class="Delimiter">.</span>push_back<span class="Delimiter">(</span>deep_copy<span class="Delimiter">(</span>input<span class="Delimiter">,</span> tmp<span class="Delimiter">));</span> <span class="Comment">// reclaim Mu memory allocated for tmp</span> trace<span class="Delimiter">(</span><span class="Constant">9991</span><span class="Delimiter">,</span> <span class="Constant">"run"</span><span class="Delimiter">)</span> << <span class="Constant">"deep-copy: reclaiming temporary"</span> << end<span class="Delimiter">();</span> - abandon<span class="Delimiter">(</span>tmp<span class="Delimiter">.</span>value<span class="Delimiter">,</span> tmp<span class="Delimiter">.</span>type<span class="Delimiter">-></span>right<span class="Delimiter">,</span> payload_size<span class="Delimiter">(</span>tmp<span class="Delimiter">));</span> + abandon<span class="Delimiter">(</span>tmp<span class="Delimiter">.</span>value<span class="Delimiter">,</span> payload_type<span class="Delimiter">(</span>tmp<span class="Delimiter">.</span>type<span class="Delimiter">),</span> payload_size<span class="Delimiter">(</span>tmp<span class="Delimiter">));</span> <span class="Comment">// reclaim host memory allocated for tmp.type when tmp goes out of scope</span> <span class="Identifier">break</span><span class="Delimiter">;</span> <span class="Delimiter">}</span> @@ -319,7 +319,10 @@ vector<<span class="Normal">double</span>> deep_copy<span class="Delimiter <span class="Comment">// construct a fake reagent that reads directly from the appropriate</span> <span class="Comment">// field of the container</span> reagent curr<span class="Delimiter">;</span> - curr<span class="Delimiter">.</span>type = <span class="Normal">new</span> type_tree<span class="Delimiter">(</span><span class="Normal">new</span> type_tree<span class="Delimiter">(</span><span class="Constant">"address"</span><span class="Delimiter">),</span> <span class="Normal">new</span> type_tree<span class="Delimiter">(</span>*info<span class="Delimiter">-></span>payload_type<span class="Delimiter">));</span> + <span class="Normal">if</span> <span class="Delimiter">(</span>info<span class="Delimiter">-></span>payload_type<span class="Delimiter">-></span>atom<span class="Delimiter">)</span> + curr<span class="Delimiter">.</span>type = <span class="Normal">new</span> type_tree<span class="Delimiter">(</span><span class="Normal">new</span> type_tree<span class="Delimiter">(</span><span class="Constant">"address"</span><span class="Delimiter">),</span> <span class="Normal">new</span> type_tree<span class="Delimiter">(</span><span class="Normal">new</span> type_tree<span class="Delimiter">(</span>info<span class="Delimiter">-></span>payload_type<span class="Delimiter">-></span>name<span class="Delimiter">),</span> <span class="Constant">NULL</span><span class="Delimiter">));</span> + <span class="Normal">else</span> + curr<span class="Delimiter">.</span>type = <span class="Normal">new</span> type_tree<span class="Delimiter">(</span><span class="Normal">new</span> type_tree<span class="Delimiter">(</span><span class="Constant">"address"</span><span class="Delimiter">),</span> <span class="Normal">new</span> type_tree<span class="Delimiter">(</span>*info<span class="Delimiter">-></span>payload_type<span class="Delimiter">));</span> curr<span class="Delimiter">.</span>set_value<span class="Delimiter">(</span>canonized_in<span class="Delimiter">.</span>value + info<span class="Delimiter">-></span>offset<span class="Delimiter">);</span> curr<span class="Delimiter">.</span>properties<span class="Delimiter">.</span>push_back<span class="Delimiter">(</span>pair<string<span class="Delimiter">,</span> string_tree*><span class="Delimiter">(</span><span class="Constant">"raw"</span><span class="Delimiter">,</span> <span class="Constant">NULL</span><span class="Delimiter">));</span> trace<span class="Delimiter">(</span><span class="Constant">9991</span><span class="Delimiter">,</span> <span class="Constant">"run"</span><span class="Delimiter">)</span> << <span class="Constant">"deep-copy: copying address "</span> << curr<span class="Delimiter">.</span>value << end<span class="Delimiter">();</span> |