Ignore:
Timestamp:
May 10, 2017, 5:00:47 PM (8 years ago)
Author:
Thierry Delisle <tdelisle@…>
Branches:
ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, deferred_resn, demangler, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, pthread-emulation, qualifiedEnum, resolv-new, with_gc
Children:
8514fe19, dbfb35d
Parents:
0f9bef3 (diff), 29cf9c8 (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.
Message:

Merge branch 'master' of plg.uwaterloo.ca:software/cfa/cfa-cc

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/benchmark/bench.c

    r0f9bef3 r6250a312  
    44#include <thread>
    55
    6 #include <unistd.h>                                     // sysconf
    7 #include <sys/times.h>                                  // times
    8 #include <time.h>
    9 
    10 inline unsigned long long int Time() {
    11     timespec ts;
    12     clock_gettime(
    13 #if defined( __linux__ )
    14          CLOCK_THREAD_CPUTIME_ID,
    15 #elif defined( __freebsd__ )
    16          CLOCK_PROF,
    17 #elif defined( __solaris__ )
    18          CLOCK_HIGHRES,
    19 #else
    20     #error uC++ : internal error, unsupported architecture
    21 #endif
    22          &ts );
    23     return 1000000000LL * ts.tv_sec + ts.tv_nsec;
    24 } // Time
     6#include "bench.h"
    257
    268//=======================================
     
    8668//=======================================
    8769
    88 struct CoroutineDummy { coroutine_desc __cor; };
    89 DECL_COROUTINE(CoroutineDummy);
     70coroutine CoroutineDummy {};
    9071void main(CoroutineDummy * this) {}
    9172
     
    11798}
    11899
    119 struct CoroutineResume {
     100coroutine CoroutineResume {
    120101    int N;
    121     coroutine_desc __cor;
    122102};
    123 
    124 DECL_COROUTINE(CoroutineResume);
    125103
    126104void ?{}(CoroutineResume* this, int N) {
     
    150128//=======================================
    151129
    152 struct ThreadDummy { thread_desc __thrd; };
    153 DECL_THREAD(ThreadDummy);
     130thread ThreadDummy {};
    154131void main(ThreadDummy * this) {}
    155132
     
    177154}
    178155
    179 struct ContextSwitch {
     156thread ContextSwitch {
    180157    int N;
    181158    long long result;
    182     thread_desc __thrd;
    183159};
    184 
    185 DECL_THREAD(ContextSwitch);
    186160
    187161void main(ContextSwitch * this) {   
     
    241215        DynamicTaskCreateDelete( NoOfTimes );
    242216        {
    243                 scoped(ContextSwitch) dummy = { (int)NoOfTimes };               // context switch
     217                ContextSwitch dummy = { (int)NoOfTimes };               // context switch
    244218        }
    245219        sout | "\t" | endl;
Note: See TracChangeset for help on using the changeset viewer.