- File:
-
- 1 edited
-
src/libcfa/concurrency/coroutine.c (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/libcfa/concurrency/coroutine.c
rc40e7c5 r169d944 10 10 // Created On : Mon Nov 28 12:27:26 2016 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Fri Jul 21 22:34:57 201713 // Update Count : 112 // Last Modified On : Thu Feb 8 16:10:31 2018 13 // Update Count : 4 14 14 // 15 15 … … 39 39 //----------------------------------------------------------------------------- 40 40 // Coroutine ctors and dtors 41 void ?{}(coStack_t& this) with( this ){42 size = 65000; // size of stack43 storage = NULL; // pointer to stack44 limit = NULL; // stack grows towards stack limit45 base = NULL; // base of stack46 context = NULL; // address of cfa_context_t47 t op = NULL; // address of top of storage48 userStack = false;41 void ?{}(coStack_t& this) { 42 this.size = 65000; // size of stack 43 this.storage = NULL; // pointer to stack 44 this.limit = NULL; // stack grows towards stack limit 45 this.base = NULL; // base of stack 46 this.context = NULL; // address of cfa_context_t 47 this.top = NULL; // address of top of storage 48 this.userStack = false; 49 49 } 50 50 … … 60 60 } 61 61 62 void ?{}(coroutine_desc& this, const char * name) with( this ){62 void ?{}(coroutine_desc& this, const char * name) { 63 63 this.name = name; 64 errno_ = 0;65 state = Start;66 starter = NULL;67 last = NULL;64 this.errno_ = 0; 65 this.state = Start; 66 this.starter = NULL; 67 this.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 f( "(coStack_t *)%p.^?{}() : internal error, mprotect failure, error(%d) %s.", &this, errno, strerror( errno ) );79 abort( "(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 f( "(uMachContext &)%p.createContext() : internal error, mprotect failure, error(%d) %s.", this, (int)errno, strerror( (int)errno ) );137 abort( "(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 f( "Attempt to allocate %d bytes of storage for coroutine or task execution-state but insufficient memory available.", size );142 abort( "Attempt to allocate %zd 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.