Changeset 7030dab for benchmark/ctxswitch/cfa_gen.cfa
- Timestamp:
- Apr 6, 2020, 4:46:28 PM (6 years ago)
- Branches:
- ADT, arm-eh, ast-experimental, enum, forall-pointer-decay, jacob/cs343-translation, master, new-ast, new-ast-unique-expr, pthread-emulation, qualifiedEnum, stuck-waitfor-destruct
- Children:
- e3bc51c
- Parents:
- 71d6bd8 (diff), 057298e (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)links above to see all the changes relative to each parent. - File:
-
- 1 edited
-
benchmark/ctxswitch/cfa_gen.cfa (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
benchmark/ctxswitch/cfa_gen.cfa
r71d6bd8 r7030dab 1 1 #include "../bench.h" 2 2 3 typedef struct { 4 void * next; 5 } GreatSuspender; 6 7 void comain( GreatSuspender * this ) { 8 if ( __builtin_expect(this->next != 0, 1) ) goto *(this->next); 9 this->next = &&s1; 3 generator G {}; 4 void main( G & ) { 10 5 for () { 11 return; 12 s1: ; 6 suspend; 13 7 } 14 8 } 15 9 16 int main( int argc, char* argv[]) {17 GreatSuspender s = { 0 };18 10 int main( int argc, char * argv[] ) { 11 G g; 12 BENCH_START() 19 13 BENCH( 20 for ( i; n) {21 comain( &s);14 for ( times ) { 15 resume( g ); 22 16 }, 23 17 result 24 18 ) 19 printf( "%g\n", result ); 20 } 25 21 26 printf("%g\n", result); 27 } 22 // Local Variables: // 23 // tab-width: 4 // 24 // End: //
Note:
See TracChangeset
for help on using the changeset viewer.