Changeset dab98b3


Ignore:
Timestamp:
Dec 6, 2019, 3:14:03 PM (2 years ago)
Author:
Thierry Delisle <tdelisle@…>
Branches:
arm-eh, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr
Children:
e1990f1
Parents:
c8c0c7c5 (diff), baf608a (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

Files:
6 edited

Legend:

Unmodified
Added
Removed
  • libcfa/src/concurrency/coroutine.cfa

    rc8c0c7c5 rdab98b3  
    1010// Created On       : Mon Nov 28 12:27:26 2016
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Sat Nov 30 09:59:36 2019
    13 // Update Count     : 14
     12// Last Modified On : Thu Dec  5 14:37:29 2019
     13// Update Count     : 15
    1414//
    1515
  • libcfa/src/concurrency/invoke.h

    rc8c0c7c5 rdab98b3  
    1010// Created On       : Tue Jan 17 12:27:26 2016
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Wed Dec  4 08:05:32 2019
    13 // Update Count     : 43
     12// Last Modified On : Thu Dec  5 16:26:03 2019
     13// Update Count     : 44
    1414//
    1515
     
    5151
    5252                        struct {
    53                                 void * stack;
    5453                                volatile unsigned short disable_count;
    5554                                volatile bool enabled;
  • libcfa/src/concurrency/kernel.cfa

    rc8c0c7c5 rdab98b3  
    1010// Created On       : Tue Jan 17 12:27:26 2017
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Tue Dec  3 21:46:54 2019
    13 // Update Count     : 49
     12// Last Modified On : Thu Dec  5 16:25:52 2019
     13// Update Count     : 52
    1414//
    1515
     
    135135        NULL,                                                                                           // cannot use 0p
    136136        NULL,
    137         { NULL, 1, false, false },
     137        { 1, false, false },
    138138        6u //this should be seeded better but due to a bug calling rdtsc doesn't work
    139139};
     
    453453
    454454        size_t stacksize;
    455          // default stack size, normally defined by shell limit
     455        // default stack size, normally defined by shell limit
    456456        Abort( pthread_attr_getstacksize( &attr, &stacksize ), "pthread_attr_getstacksize" );
    457457        assert( stacksize >= PTHREAD_STACK_MIN );
    458458
    459 #ifdef __CFA_DEBUG__
    460         void * stack = memalign( __page_size, stacksize + __page_size );
    461         // pthread has no mechanism to create the guard page in user supplied stack.
    462         if ( mprotect( stack, __page_size, PROT_NONE ) == -1 ) {
    463                 abort( "mprotect : internal error, mprotect failure, error(%d) %s.", errno, strerror( errno ) );
    464         } // if
    465 #else
    466         void * stack = malloc( stacksize );
    467 #endif
     459        void * stack;
     460        __cfaabi_dbg_debug_do(
     461                stack = memalign( __page_size, stacksize + __page_size );
     462                // pthread has no mechanism to create the guard page in user supplied stack.
     463                if ( mprotect( stack, __page_size, PROT_NONE ) == -1 ) {
     464                        abort( "mprotect : internal error, mprotect failure, error(%d) %s.", errno, strerror( errno ) );
     465                } // if
     466        );
     467        __cfaabi_dbg_no_debug_do(
     468                stack = malloc( stacksize );
     469        );
    468470
    469471        Abort( pthread_attr_setstack( &attr, stack, stacksize ), "pthread_attr_setstack" );
  • libcfa/src/concurrency/preemption.cfa

    rc8c0c7c5 rdab98b3  
    1010// Created On       : Mon Jun 5 14:20:42 2017
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Sun Dec  1 22:22:56 2019
    13 // Update Count     : 41
     12// Last Modified On : Thu Dec  5 16:34:05 2019
     13// Update Count     : 43
    1414//
    1515
     
    6565event_kernel_t * event_kernel;                        // kernel public handle to even kernel
    6666static pthread_t alarm_thread;                        // pthread handle to alarm thread
     67static void * alarm_stack;                                                        // pthread stack for alarm thread
    6768
    6869static void ?{}(event_kernel_t & this) with( this ) {
     
    306307        signal_block( SIGALRM );
    307308
    308         kernelTLS.preemption_state.stack = create_pthread( &alarm_thread, alarm_loop, 0p );
     309        alarm_stack = create_pthread( &alarm_thread, alarm_loop, 0p );
    309310}
    310311
     
    326327
    327328        pthread_join( alarm_thread, 0p );
    328         free( kernelTLS.preemption_state.stack );
     329        free( alarm_stack );
    329330
    330331        // Preemption is now fully stopped
  • libcfa/src/heap.cfa

    rc8c0c7c5 rdab98b3  
    1010// Created On       : Tue Dec 19 21:58:35 2017
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Tue Dec  3 13:58:44 2019
    13 // Update Count     : 642
     12// Last Modified On : Wed Dec  4 21:42:46 2019
     13// Update Count     : 646
    1414//
    1515
     
    3535static bool traceHeap = false;
    3636
    37 inline bool traceHeap() {
    38         return traceHeap;
    39 } // traceHeap
     37inline bool traceHeap() { return traceHeap; }
    4038
    4139bool traceHeapOn() {
     
    5048        return temp;
    5149} // traceHeapOff
     50
     51bool traceHeapTerm() { return false; }
    5252
    5353
     
    694694static void ^?{}( HeapManager & ) {
    695695        #ifdef __STATISTICS__
    696         // if ( traceHeapTerm() ) {
    697         //      printStats();
    698         //      if ( prtfree() ) prtFree( heapManager, true );
    699         // } // if
     696        if ( traceHeapTerm() ) {
     697                printStats();
     698                // if ( prtfree() ) prtFree( heapManager, true );
     699        } // if
    700700        #endif // __STATISTICS__
    701701} // ~HeapManager
  • tests/linking/withthreads.cfa

    rc8c0c7c5 rdab98b3  
    3434// Local Variables: //
    3535// tab-width: 4 //
    36 // compile-command: "cfa nothreads.cfa" //
     36// compile-command: "cfa withthreads.cfa" //
    3737// End: //
Note: See TracChangeset for help on using the changeset viewer.