- File:
-
- 1 edited
-
src/libcfa/concurrency/coroutine.c (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/libcfa/concurrency/coroutine.c
r169d944 rc40e7c5 10 10 // Created On : Mon Nov 28 12:27:26 2016 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Thu Feb 8 16:10:31 201813 // Update Count : 412 // Last Modified On : Fri Jul 21 22:34:57 2017 13 // Update Count : 1 14 14 // 15 15 … … 39 39 //----------------------------------------------------------------------------- 40 40 // Coroutine ctors and dtors 41 void ?{}(coStack_t& this) {42 this.size = 65000; // size of stack43 this.storage = NULL; // pointer to stack44 this.limit = NULL; // stack grows towards stack limit45 this.base = NULL; // base of stack46 this.context = NULL; // address of cfa_context_t47 t his.top = NULL; // address of top of storage48 this.userStack = false;41 void ?{}(coStack_t& this) with( this ) { 42 size = 65000; // size of stack 43 storage = NULL; // pointer to stack 44 limit = NULL; // stack grows towards stack limit 45 base = NULL; // base of stack 46 context = NULL; // address of cfa_context_t 47 top = NULL; // address of top of storage 48 userStack = false; 49 49 } 50 50 … … 60 60 } 61 61 62 void ?{}(coroutine_desc& this, const char * name) {62 void ?{}(coroutine_desc& this, const char * name) with( this ) { 63 63 this.name = name; 64 this.errno_ = 0;65 this.state = Start;66 this.starter = NULL;67 this.last = NULL;64 errno_ = 0; 65 state = Start; 66 starter = NULL; 67 last = NULL; 68 68 } 69 69 … … 77 77 __cfaabi_dbg_debug_do( 78 78 if ( mprotect( this.storage, pageSize, PROT_READ | PROT_WRITE ) == -1 ) { 79 abort ( "(coStack_t *)%p.^?{}() : internal error, mprotect failure, error(%d) %s.", &this, errno, strerror( errno ) );79 abortf( "(coStack_t *)%p.^?{}() : internal error, mprotect failure, error(%d) %s.", &this, errno, strerror( errno ) ); 80 80 } 81 81 ); … … 135 135 __cfaabi_dbg_debug_do( 136 136 if ( mprotect( storage, pageSize, PROT_NONE ) == -1 ) { 137 abort ( "(uMachContext &)%p.createContext() : internal error, mprotect failure, error(%d) %s.", this, (int)errno, strerror( (int)errno ) );137 abortf( "(uMachContext &)%p.createContext() : internal error, mprotect failure, error(%d) %s.", this, (int)errno, strerror( (int)errno ) ); 138 138 } // if 139 139 ); 140 140 141 141 if ( (intptr_t)storage == 0 ) { 142 abort ( "Attempt to allocate %zd bytes of storage for coroutine or task execution-state but insufficient memory available.", size );142 abortf( "Attempt to allocate %d bytes of storage for coroutine or task execution-state but insufficient memory available.", size ); 143 143 } // if 144 144
Note:
See TracChangeset
for help on using the changeset viewer.