Changeset 47ecf2b for src/libcfa/concurrency/coroutine.c
- Timestamp:
- Jul 4, 2017, 3:39:28 PM (7 years ago)
- 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:
- cd17862
- Parents:
- 8ee50281
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/libcfa/concurrency/coroutine.c
r8ee50281 r47ecf2b 44 44 // Coroutine ctors and dtors 45 45 void ?{}(coStack_t* this) { 46 this->size = 10240; // size of stack46 this->size = 65000; // size of stack 47 47 this->storage = NULL; // pointer to stack 48 48 this->limit = NULL; // stack grows towards stack limit … … 50 50 this->context = NULL; // address of cfa_context_t 51 51 this->top = NULL; // address of top of storage 52 this->userStack = false; 52 this->userStack = false; 53 53 } 54 54 … … 114 114 assert( src->stack.context ); 115 115 CtxSwitch( src->stack.context, dst->stack.context ); 116 // when CtxSwitch returns we are back in the src coroutine 116 // when CtxSwitch returns we are back in the src coroutine 117 117 118 118 // set state of new coroutine to active … … 132 132 this->size = libCeiling( storageSize, 16 ); 133 133 // use malloc/memalign because "new" raises an exception for out-of-memory 134 134 135 135 // assume malloc has 8 byte alignment so add 8 to allow rounding up to 16 byte alignment 136 136 LIB_DEBUG_DO( this->storage = memalign( pageSize, cxtSize + this->size + pageSize ) );
Note: See TracChangeset
for help on using the changeset viewer.