Changeset 6b33e89 for tests/zombies
- Timestamp:
- Apr 25, 2025, 7:39:09 AM (6 months ago)
- Branches:
- master
- Children:
- 65bd3c2
- Parents:
- b195498
- Location:
- tests/zombies
- Files:
-
- 4 edited
-
hashtable.cfa (modified) (2 diffs)
-
hashtable2.cfa (modified) (4 diffs)
-
linked-list-perf/experiment.koad (modified) (2 diffs)
-
linked-list-perf/mike-old.hfa (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
tests/zombies/hashtable.cfa
rb195498 r6b33e89 71 71 dlist(tN, tE) & bucket = buckets[ bucket_of(this, k) ]; 72 72 73 for ( tN * item = & $tempcv_e2n( bucket`first); item != 0p; item = & $tempcv_e2n((*item)`next) ) {73 for ( tN * item = & $tempcv_e2n(first( bucket )); item != 0p; item = & $tempcv_e2n((*item)`next) ) { 74 74 if ( key(*item) == k ) { 75 75 return *item; … … 94 94 dlist(tN, tE) & bucket = buckets[ bucket_of(this, k) ]; 95 95 96 for ( tN * item = & $tempcv_e2n( bucket`first); item != 0p; item = & $tempcv_e2n((*item)`next) ) {96 for ( tN * item = & $tempcv_e2n(first( bucket )); item != 0p; item = & $tempcv_e2n((*item)`next) ) { 97 97 if ( key(*item) == k ) { 98 98 remove(*item); -
tests/zombies/hashtable2.cfa
rb195498 r6b33e89 149 149 dlist(request_in_ht_by_src, request) & bucket = buckets[ bucket_of(this, k) ]; 150 150 151 for ( request_in_ht_by_src * item = & $tempcv_e2n( bucket`first); item != 0p; item = & $tempcv_e2n((*item)`next) ) {151 for ( request_in_ht_by_src * item = & $tempcv_e2n(first( bucket )); item != 0p; item = & $tempcv_e2n((*item)`next) ) { 152 152 if ( key(*item) == k ) { 153 153 return *item; … … 177 177 dlist(request_in_ht_by_src, request) & bucket = buckets[ bucket_of(this, k) ]; 178 178 179 for ( request_in_ht_by_src * item = & $tempcv_e2n( bucket`first); item != 0p; item = & $tempcv_e2n((*item)`next) ) {179 for ( request_in_ht_by_src * item = & $tempcv_e2n(first( bucket )); item != 0p; item = & $tempcv_e2n((*item)`next) ) { 180 180 if ( key(*item) == k ) { 181 181 remove(*item); … … 257 257 258 258 // will re-implement as an actual splice 259 while ( & src_to_ empty`first!= 0p ) {259 while ( & src_to_first( empty ) != 0p ) { 260 260 insert_last( snk_to_fill_at_last, pop_first( src_to_empty ) ); 261 261 } … … 319 319 320 320 // fill new table with old items 321 while ( & items`first!= 0p ) {321 while ( &first( items ) != 0p ) { 322 322 put( this, pop_first( items ) ); 323 323 } -
tests/zombies/linked-list-perf/experiment.koad
rb195498 r6b33e89 144 144 for ( volatile unsigned int t = 0; t < Times; t += 1 ) { 145 145 Repeat( insert_last( lst, s[i] ) ); 146 Repeat( remove( lst`first) );146 Repeat( remove( first( lst ) ) ); 147 147 } 148 148 end = clock(); … … 168 168 for ( volatile unsigned int t = 0; t < Times; t += 1 ) { 169 169 Repeat( insert_last( lst, s[i] ) ); 170 Repeat( remove( lst`first) );170 Repeat( remove( first( lst ) ) ); 171 171 } 172 172 end = clock(); -
tests/zombies/linked-list-perf/mike-old.hfa
rb195498 r6b33e89 9 9 // Author : Michael Brooks 10 10 // Created On : Wed Apr 22 18:00:00 2020 11 // Last Modified By : Michael Brooks12 // Last Modified On : Wed Apr 22 18:00:00 202013 // Update Count : 111 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Mon Apr 21 17:32:37 2025 13 // Update Count : 3 14 14 // 15 15 … … 147 147 } 148 148 149 static inline Telem & ?`first( dlist(Tnode, Telem) &l ) {149 static inline Telem & first( dlist(Tnode, Telem) &l ) { 150 150 return * l.$links.next.elem; 151 151 } … … 157 157 #if !defined(NDEBUG) && (defined(__CFA_DEBUG__) || defined(__CFA_VERIFY__)) 158 158 static bool $validate_fwd( dlist(Tnode, Telem) & this ) { 159 Tnode * it = & $tempcv_e2n( this`first);159 Tnode * it = & $tempcv_e2n( first( this ) ); 160 160 if (!it) return (& this`last == 0p); 161 161 … … 170 170 static bool $validate_rev( dlist(Tnode, Telem) & this ) { 171 171 Tnode * it = & $tempcv_e2n( this`last ); 172 if (!it) return (& this`first== 0p);172 if (!it) return (& first( this ) == 0p); 173 173 174 174 while( $prev_link(*it).elem ) { … … 176 176 } 177 177 178 return ( it == & $tempcv_e2n( this`first) ) &&178 return ( it == & $tempcv_e2n( first( this ) ) ) && 179 179 ( $prev_link(*it).is_terminator ) && 180 180 ( ((dlist(Tnode, Telem)*)$prev_link(*it).terminator) == &this );
Note:
See TracChangeset
for help on using the changeset viewer.