diff options
author | Kartik K. Agaram <vc@akkartik.com> | 2016-08-17 19:04:35 -0700 |
---|---|---|
committer | Kartik K. Agaram <vc@akkartik.com> | 2016-08-17 19:04:35 -0700 |
commit | d990e8f07aee36f68bcd270889d20c2d22b9aa0b (patch) | |
tree | 07a624ea81f2974e1bb038462f4d0607237ea431 /html/074deep_copy.cc.html | |
parent | cb159b8c8a888f089676a63273b76b641e860d88 (diff) | |
download | mu-d990e8f07aee36f68bcd270889d20c2d22b9aa0b.tar.gz |
3219
Trying keeping html in the master branch: https://github.com/blog/2228-simpler-github-pages-publishing Let's see if https://akkartik.github.io/mu updates after I push this commit to just the master branch.
Diffstat (limited to 'html/074deep_copy.cc.html')
-rw-r--r-- | html/074deep_copy.cc.html | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/html/074deep_copy.cc.html b/html/074deep_copy.cc.html index 1a352a85..4a520023 100644 --- a/html/074deep_copy.cc.html +++ b/html/074deep_copy.cc.html @@ -248,7 +248,7 @@ put<span class="Delimiter">(</span>Recipe_ordinal<span class="Delimiter">,</span <span class="Comment">// allocate a tiny bit of temporary space for deep_copy()</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: allocating space for temporary"</span> << end<span class="Delimiter">();</span> reagent tmp<span class="Delimiter">(</span><span class="Constant">"tmp:address:number"</span><span class="Delimiter">);</span> - tmp<span class="Delimiter">.</span>value = allocate<span class="Delimiter">(</span><span class="Constant">1</span><span class="Delimiter">);</span> + tmp<span class="Delimiter">.</span>set_value<span class="Delimiter">(</span>allocate<span class="Delimiter">(</span><span class="Constant">1</span><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> @@ -295,10 +295,10 @@ vector<<span class="Normal">double</span>> deep_copy<span class="Delimiter <span class="Comment">// a temporary location to help copy the payload.</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: writing temporary "</span> << tmp<span class="Delimiter">.</span>value << <span class="Constant">": "</span> << out << end<span class="Delimiter">();</span> put<span class="Delimiter">(</span>Memory<span class="Delimiter">,</span> tmp<span class="Delimiter">.</span>value<span class="Delimiter">,</span> out<span class="Delimiter">);</span> - payload<span class="Delimiter">.</span>value = tmp<span class="Delimiter">.</span>value<span class="Delimiter">;</span> <span class="Comment">// now modified for output</span> + payload<span class="Delimiter">.</span>set_value<span class="Delimiter">(</span>tmp<span class="Delimiter">.</span>value<span class="Delimiter">);</span> <span class="Comment">// now modified for output</span> vector<<span class="Normal">double</span>> old_data = read_memory<span class="Delimiter">(</span>payload<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: really writing to "</span> << payload<span class="Delimiter">.</span>value << <span class="Constant">' '</span> << to_string<span class="Delimiter">(</span>payload<span class="Delimiter">)</span> << <span class="Constant">" (old value "</span> << to_string<span class="Delimiter">(</span>old_data<span class="Delimiter">)</span> << <span class="Constant">" new value "</span> << to_string<span class="Delimiter">(</span>data<span class="Delimiter">)</span> << <span class="Constant">")"</span> << end<span class="Delimiter">();</span> - write_memory<span class="Delimiter">(</span>payload<span class="Delimiter">,</span> data<span class="Delimiter">,</span> -<span class="Constant">1</span><span class="Delimiter">);</span> + write_memory<span class="Delimiter">(</span>payload<span class="Delimiter">,</span> data<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: output is "</span> << to_string<span class="Delimiter">(</span>data<span class="Delimiter">)</span> << end<span class="Delimiter">();</span> <span class="Identifier">return</span> out<span class="Delimiter">;</span> <span class="Delimiter">}</span> |