Ignore:
Timestamp:
Apr 4, 2019, 3:37:55 PM (3 years ago)
Author:
tdelisle <tdelisle@…>
Branches:
arm-eh, cleanup-dtors, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr
Children:
8c01e1b
Parents:
2fabdc02
Message:

Swapped memory storage for context and stack information inside the coroutine implementation

File:
1 edited

Legend:

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

    r2fabdc02 rb2f6113  
    6868// Private wrappers for context switch and stack creation
    6969extern void CoroutineCtxSwitch(coroutine_desc * src, coroutine_desc * dst);
    70 extern void create_stack( coStack_t * this, unsigned int storageSize );
     70extern void __stack_prepare   ( __stack_info_t * this, size_t size /* ignored if storage already allocated */);
    7171
    7272// Suspend implementation inlined for performance
     
    102102        coroutine_desc * dst = get_coroutine(cor);
    103103
    104         if( unlikely(!dst->stack.base) ) {
    105                 create_stack(&dst->stack, dst->stack.size);
     104        if( unlikely(!dst->stack.storage || !dst->stack.storage->base) ) {
     105                __stack_prepare(&dst->stack, 65000);
    106106                CtxStart(&cor, CtxInvokeCoroutine);
    107107        }
Note: See TracChangeset for help on using the changeset viewer.