diff options
author | Kartik K. Agaram <vc@akkartik.com> | 2016-12-12 10:01:12 -0800 |
---|---|---|
committer | Kartik K. Agaram <vc@akkartik.com> | 2016-12-12 10:07:59 -0800 |
commit | 49620728e805a3bbc3477c14b8b6ef7e2b5d3ead (patch) | |
tree | c80ecf970ec78dfc0c40944a4b9e827c0eb77078 /html/043space.cc.html | |
parent | d81fcff20567a1d5e793e813bc761222885660b1 (diff) | |
download | mu-49620728e805a3bbc3477c14b8b6ef7e2b5d3ead.tar.gz |
3707
Be more disciplined about tagging 2 different concepts in the codebase: a) Use the phrase "later layers" to highlight places where a layer doesn't have the simplest possible self-contained implementation. b) Use the word "hook" to point out functions that exist purely to provide waypoints for extension by future layers. Since both these only make sense in the pre-tangled representation of the codebase, using '//:' and '#:' comments to get them stripped out of tangled output. (Though '#:' comments still make it to tangled output at the moment. Let's see if we use it enough to be worth supporting. Scenarios are pretty unreadable in tangled output anyway.)
Diffstat (limited to 'html/043space.cc.html')
-rw-r--r-- | html/043space.cc.html | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/html/043space.cc.html b/html/043space.cc.html index 5de969b0..617bd873 100644 --- a/html/043space.cc.html +++ b/html/043space.cc.html @@ -106,8 +106,8 @@ absolutize<span class="Delimiter">(</span>x<span class="Delimiter">);</span> assert<span class="Delimiter">(</span>is_raw<span class="Delimiter">(</span>x<span class="Delimiter">));</span> <span class="Delimiter">}</span> +<span class="Comment">//: hook replaced in a later layer</span> <span class="Normal">int</span> space_base<span class="Delimiter">(</span><span class="Normal">const</span> reagent& x<span class="Delimiter">)</span> <span class="Delimiter">{</span> - <span class="Comment">// temporary stub; will be replaced in a later layer</span> <span class="Identifier">return</span> current_call<span class="Delimiter">().</span>default_space ? <span class="Delimiter">(</span>current_call<span class="Delimiter">().</span>default_space+<span class="Comment">/*</span><span class="Comment">skip refcount</span><span class="Comment">*/</span><span class="Constant">1</span><span class="Delimiter">)</span> : <span class="Constant">0</span><span class="Delimiter">;</span> <span class="Delimiter">}</span> @@ -428,10 +428,7 @@ Transform<span class="Delimiter">.</span>push_back<span class="Delimiter">(</spa <span class="Normal">void</span> check_default_space<span class="Delimiter">(</span><span class="Normal">const</span> recipe_ordinal r<span class="Delimiter">)</span> <span class="Delimiter">{</span> <span class="Normal">if</span> <span class="Delimiter">(</span>Hide_missing_default_space_errors<span class="Delimiter">)</span> <span class="Identifier">return</span><span class="Delimiter">;</span> <span class="Comment">// skip previous core tests; this is only for Mu code</span> <span class="Normal">const</span> recipe& caller = get<span class="Delimiter">(</span>Recipe<span class="Delimiter">,</span> r<span class="Delimiter">);</span> - <span class="Comment">// skip scenarios (later layer)</span> - <span class="Comment">// user code should never create recipes with underscores in their names</span> - <span class="Normal">if</span> <span class="Delimiter">(</span>caller<span class="Delimiter">.</span>name<span class="Delimiter">.</span>find<span class="Delimiter">(</span><span class="Constant">"scenario_"</span><span class="Delimiter">)</span> == <span class="Constant">0</span><span class="Delimiter">)</span> <span class="Identifier">return</span><span class="Delimiter">;</span> <span class="Comment">// skip Mu scenarios which will use raw memory locations</span> - <span class="Normal">if</span> <span class="Delimiter">(</span>caller<span class="Delimiter">.</span>name<span class="Delimiter">.</span>find<span class="Delimiter">(</span><span class="Constant">"run_"</span><span class="Delimiter">)</span> == <span class="Constant">0</span><span class="Delimiter">)</span> <span class="Identifier">return</span><span class="Delimiter">;</span> <span class="Comment">// skip calls to 'run', which should be in scenarios and will also use raw memory locations</span> + <span class="Comment">// End check_default_space Special-cases</span> <span class="Comment">// assume recipes with only numeric addresses know what they're doing (usually tests)</span> <span class="Normal">if</span> <span class="Delimiter">(</span>!contains_non_special_name<span class="Delimiter">(</span>r<span class="Delimiter">))</span> <span class="Identifier">return</span><span class="Delimiter">;</span> trace<span class="Delimiter">(</span><span class="Constant">9991</span><span class="Delimiter">,</span> <span class="Constant">"transform"</span><span class="Delimiter">)</span> << <span class="Constant">"--- check that recipe "</span> << caller<span class="Delimiter">.</span>name << <span class="Constant">" sets default-space"</span> << end<span class="Delimiter">();</span> |