File tree Expand file tree Collapse file tree 1 file changed +2
-17
lines changed
portable/ThirdParty/GCC/Posix Expand file tree Collapse file tree 1 file changed +2
-17
lines changed Original file line number Diff line number Diff line change @@ -165,30 +165,15 @@ StackType_t * pxPortInitialiseStack( StackType_t * pxTopOfStack,
165165 thread = ( Thread_t * ) ( pxTopOfStack + 1 ) - 1 ;
166166 pxTopOfStack = ( StackType_t * ) thread - 1 ;
167167
168+ /* Ensure that there is enough space to store Thread_t on the stack. */
168169 ulStackSize = ( size_t ) ( pxTopOfStack + 1 - pxEndOfStack ) * sizeof ( * pxTopOfStack );
169-
170- #ifdef __APPLE__
171- /*
172- * On macOS, pthread_attr_setstacksize requires the stack to be a multiple of the system page size.
173- * Round up to the next page boundary.
174- */
175- ulStackSize = mach_vm_round_page ( ulStackSize );
176- #endif
170+ configASSERT ( ulStackSize > sizeof ( Thread_t ) );
177171
178172 thread -> pxCode = pxCode ;
179173 thread -> pvParams = pvParameters ;
180174 thread -> xDying = pdFALSE ;
181175
182- /* Ensure ulStackSize is at least PTHREAD_STACK_MIN */
183- ulStackSize = (ulStackSize < ( size_t ) ( PTHREAD_STACK_MIN ) ) ? ( size_t ) ( PTHREAD_STACK_MIN ) : ulStackSize ;
184-
185176 pthread_attr_init ( & xThreadAttributes );
186- iRet = pthread_attr_setstacksize ( & xThreadAttributes , ulStackSize );
187-
188- if ( iRet != 0 )
189- {
190- fprintf ( stderr , "[WARN] pthread_attr_setstacksize failed with return value: %d. Default stack size will be used.\n" , iRet );
191- }
192177
193178 thread -> ev = event_create ();
194179
You can’t perform that action at this time.
0 commit comments