diff options
Diffstat (limited to 'html/069hash.cc.html')
-rw-r--r-- | html/069hash.cc.html | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/html/069hash.cc.html b/html/069hash.cc.html index 9521a756..00d88349 100644 --- a/html/069hash.cc.html +++ b/html/069hash.cc.html @@ -63,7 +63,7 @@ if ('onhashchange' in window) { </head> <body onload='JumpToLine();'> <pre id='vimCodeElement'> -<span id="L1" class="LineNr"> 1 </span><span class="Comment">// A universal hash function that can handle objects of any type.</span> +<span id="L1" class="LineNr"> 1 </span><span class="Comment">// Compute a hash for objects of any type.</span> <span id="L2" class="LineNr"> 2 </span><span class="Comment">//</span> <span id="L3" class="LineNr"> 3 </span><span class="Comment">// The way it's currently implemented, two objects will have the same hash if</span> <span id="L4" class="LineNr"> 4 </span><span class="Comment">// all their non-address fields (all the way down) expand to the same sequence</span> @@ -120,10 +120,10 @@ if ('onhashchange' in window) { <span id="L55" class="LineNr"> 55 </span> <span id="L56" class="LineNr"> 56 </span><span class="Normal">size_t</span> <a href='069hash.cc.html#L56'>hash_mu_address</a><span class="Delimiter">(</span><span class="Normal">size_t</span> h<span class="Delimiter">,</span> reagent& r<span class="Delimiter">)</span> <span class="Delimiter">{</span> <span id="L57" class="LineNr"> 57 </span> <span class="Normal">if</span> <span class="Delimiter">(</span>r<span class="Delimiter">.</span>value == <span class="Constant">0</span><span class="Delimiter">)</span> <span class="Identifier">return</span> <span class="Constant">0</span><span class="Delimiter">;</span> -<span id="L58" class="LineNr"> 58 </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">"location "</span> << r<span class="Delimiter">.</span>value << <span class="Constant">" is "</span> << no_scientific<span class="Delimiter">(</span><a href='001help.cc.html#L228'>get_or_insert</a><span class="Delimiter">(</span>Memory<span class="Delimiter">,</span> r<span class="Delimiter">.</span>value<span class="Delimiter">))</span> << <a href='003trace.cc.html#L197'>end</a><span class="Delimiter">();</span> +<span id="L58" class="LineNr"> 58 </span> <a href='003trace.cc.html#L161'>trace</a><span class="Delimiter">(</span><span class="Constant">"mem"</span><span class="Delimiter">)</span> << <span class="Constant">"location "</span> << r<span class="Delimiter">.</span>value << <span class="Constant">" is "</span> << no_scientific<span class="Delimiter">(</span><a href='001help.cc.html#L228'>get_or_insert</a><span class="Delimiter">(</span>Memory<span class="Delimiter">,</span> r<span class="Delimiter">.</span>value<span class="Delimiter">))</span> << <a href='003trace.cc.html#L197'>end</a><span class="Delimiter">();</span> <span id="L59" class="LineNr"> 59 </span> r<span class="Delimiter">.</span><a href='010vm.cc.html#L65'>set_value</a><span class="Delimiter">(</span><a href='001help.cc.html#L228'>get_or_insert</a><span class="Delimiter">(</span>Memory<span class="Delimiter">,</span> r<span class="Delimiter">.</span>value<span class="Delimiter">));</span> <span id="L60" class="LineNr"> 60 </span> <span class="Normal">if</span> <span class="Delimiter">(</span>r<span class="Delimiter">.</span>value != <span class="Constant">0</span><span class="Delimiter">)</span> <span class="Delimiter">{</span> -<span id="L61" class="LineNr"> 61 </span> <span class="Conceal">¦</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">"skipping refcount at "</span> << r<span class="Delimiter">.</span>value << <a href='003trace.cc.html#L197'>end</a><span class="Delimiter">();</span> +<span id="L61" class="LineNr"> 61 </span> <span class="Conceal">¦</span> <a href='003trace.cc.html#L161'>trace</a><span class="Delimiter">(</span><span class="Constant">"mem"</span><span class="Delimiter">)</span> << <span class="Constant">"skipping refcount at "</span> << r<span class="Delimiter">.</span>value << <a href='003trace.cc.html#L197'>end</a><span class="Delimiter">();</span> <span id="L62" class="LineNr"> 62 </span> <span class="Conceal">¦</span> r<span class="Delimiter">.</span><a href='010vm.cc.html#L65'>set_value</a><span class="Delimiter">(</span>r<span class="Delimiter">.</span>value+<span class="Constant">1</span><span class="Delimiter">);</span> <span class="Comment">// skip refcount</span> <span id="L63" class="LineNr"> 63 </span> <span class="Delimiter">}</span> <span id="L64" class="LineNr"> 64 </span> drop_from_type<span class="Delimiter">(</span>r<span class="Delimiter">,</span> <span class="Constant">"address"</span><span class="Delimiter">);</span> @@ -144,9 +144,9 @@ if ('onhashchange' in window) { <span id="L79" class="LineNr"> 79 </span> reagent<span class="Comment">/*</span><span class="Comment">copy</span><span class="Comment">*/</span> elem = r<span class="Delimiter">;</span> <span id="L80" class="LineNr"> 80 </span> <span class="Normal">delete</span> elem<span class="Delimiter">.</span>type<span class="Delimiter">;</span> <span id="L81" class="LineNr"> 81 </span> elem<span class="Delimiter">.</span>type = <a href='032array.cc.html#L377'>copy_array_element</a><span class="Delimiter">(</span>r<span class="Delimiter">.</span>type<span class="Delimiter">);</span> -<span id="L82" class="LineNr"> 82 </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> <a href='043space.cc.html#L83'>address</a> = r<span class="Delimiter">.</span>value+<span class="Constant">1</span><span class="Delimiter">;</span> i < size<span class="Delimiter">;</span> ++i<span class="Delimiter">,</span> <a href='043space.cc.html#L83'>address</a> += size_of<span class="Delimiter">(</span>elem<span class="Delimiter">))</span> <span class="Delimiter">{</span> +<span id="L82" class="LineNr"> 82 </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> <a href='043space.cc.html#L82'>address</a> = r<span class="Delimiter">.</span>value+<span class="Constant">1</span><span class="Delimiter">;</span> i < size<span class="Delimiter">;</span> ++i<span class="Delimiter">,</span> <a href='043space.cc.html#L82'>address</a> += size_of<span class="Delimiter">(</span>elem<span class="Delimiter">))</span> <span class="Delimiter">{</span> <span id="L83" class="LineNr"> 83 </span> <span class="Conceal">¦</span> reagent<span class="Comment">/*</span><span class="Comment">copy</span><span class="Comment">*/</span> tmp = elem<span class="Delimiter">;</span> -<span id="L84" class="LineNr"> 84 </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#L83'>address</a><span class="Delimiter">);</span> +<span id="L84" class="LineNr"> 84 </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#L82'>address</a><span class="Delimiter">);</span> <span id="L85" class="LineNr"> 85 </span> <span class="Conceal">¦</span> h = <a href='069hash.cc.html#L34'>hash</a><span class="Delimiter">(</span>h<span class="Delimiter">,</span> tmp<span class="Delimiter">);</span> <span id="L86" class="LineNr"> 86 </span><span class="CommentedCode">//? cerr << i << " (" << address << "): " << h << '\n';</span> <span id="L87" class="LineNr"> 87 </span> <span class="Delimiter">}</span> @@ -155,7 +155,7 @@ if ('onhashchange' in window) { <span id="L90" class="LineNr"> 90 </span> <span id="L91" class="LineNr"> 91 </span><span class="Normal">size_t</span> <a href='069hash.cc.html#L91'>hash_mu_container</a><span class="Delimiter">(</span><span class="Normal">size_t</span> h<span class="Delimiter">,</span> <span class="Normal">const</span> reagent& r<span class="Delimiter">)</span> <span class="Delimiter">{</span> <span id="L92" class="LineNr"> 92 </span> type_info& info = get<span class="Delimiter">(</span>Type<span class="Delimiter">,</span> get_base_type<span class="Delimiter">(</span>r<span class="Delimiter">.</span>type<span class="Delimiter">)-></span>value<span class="Delimiter">);</span> -<span id="L93" class="LineNr"> 93 </span> <span class="Normal">int</span> <a href='043space.cc.html#L83'>address</a> = r<span class="Delimiter">.</span>value<span class="Delimiter">;</span> +<span id="L93" class="LineNr"> 93 </span> <span class="Normal">int</span> <a href='043space.cc.html#L82'>address</a> = r<span class="Delimiter">.</span>value<span class="Delimiter">;</span> <span id="L94" class="LineNr"> 94 </span> <span class="Normal">int</span> offset = <span class="Constant">0</span><span class="Delimiter">;</span> <span id="L95" class="LineNr"> 95 </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='001help.cc.html#L141'>SIZE</a><span class="Delimiter">(</span>info<span class="Delimiter">.</span>elements<span class="Delimiter">);</span> ++i<span class="Delimiter">)</span> <span class="Delimiter">{</span> <span id="L96" class="LineNr"> 96 </span> <span class="Conceal">¦</span> reagent<span class="Comment">/*</span><span class="Comment">copy</span><span class="Comment">*/</span> element = <a href='030container.cc.html#L429'>element_type</a><span class="Delimiter">(</span>r<span class="Delimiter">.</span>type<span class="Delimiter">,</span> i<span class="Delimiter">);</span> |