Ignore:
File:
1 edited

Legend:

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

    rfd54fef r5456537  
    4646
    4747//-----------------------------------------------------------------------------
    48 FORALL_DATA_INSTANCE(CoroutineCancelled, (coroutine_t &), (coroutine_t))
    49 
    50 forall(T &)
    51 void mark_exception(CoroutineCancelled(T) *) {}
    52 
    5348forall(T &)
    5449void copy(CoroutineCancelled(T) * dst, CoroutineCancelled(T) * src) {
     
    6560// This code should not be inlined. It is the error path on resume.
    6661forall(T & | is_coroutine(T))
    67 void __cfaehm_cancelled_coroutine( T & cor, $coroutine * desc ) {
     62void __cfaehm_cancelled_coroutine(
     63                T & cor, $coroutine * desc, EHM_DEFAULT_VTABLE(CoroutineCancelled, (T)) ) {
    6864        verify( desc->cancellation );
    6965        desc->state = Cancelled;
     
    7268        // TODO: Remove explitate vtable set once trac#186 is fixed.
    7369        CoroutineCancelled(T) except;
    74         except.virtual_table = &get_exception_vtable(&except);
     70        except.virtual_table = &_default_vtable;
    7571        except.the_coroutine = &cor;
    7672        except.the_exception = except;
    77         throwResume except;
     73        // Why does this need a cast?
     74        throwResume (CoroutineCancelled(T) &)except;
    7875
    7976        except->virtual_table->free( except );
     
    148145// Part of the Public API
    149146// Not inline since only ever called once per coroutine
    150 forall(T & | is_coroutine(T))
     147forall(T & | is_coroutine(T) | { EHM_DEFAULT_VTABLE(CoroutineCancelled, (T)); })
    151148void prime(T& cor) {
    152149        $coroutine* this = get_coroutine(cor);
     
    196193
    197194void __stack_clean  ( __stack_info_t * this ) {
    198         size_t size = ((intptr_t)this->storage->base) - ((intptr_t)this->storage->limit) + sizeof(__stack_t);
    199195        void * storage = this->storage->limit;
    200196
    201197        #if CFA_COROUTINE_USE_MMAP
     198                size_t size = ((intptr_t)this->storage->base) - ((intptr_t)this->storage->limit) + sizeof(__stack_t);
    202199                storage = (void *)(((intptr_t)storage) - __page_size);
    203200                if(munmap(storage, size + __page_size) == -1) {
Note: See TracChangeset for help on using the changeset viewer.