rymanluk commented on a change in pull request #548: os_task: Moved the 
initialisation of t_stacktop and t_stacksize.
URL: https://github.com/apache/mynewt-core/pull/548#discussion_r139089826
 
 

 ##########
 File path: kernel/os/src/os_task.c
 ##########
 @@ -129,10 +129,10 @@ os_task_init(struct os_task *t, const char *name, 
os_task_func_t func,
     }
 
     _clear_stack(stack_bottom, stack_size);
-    t->t_stackptr = os_arch_task_stack_init(t, &stack_bottom[stack_size],
-            stack_size);
     t->t_stacktop = &stack_bottom[stack_size];
     t->t_stacksize = stack_size;
+    t->t_stackptr = os_arch_task_stack_init(t, &stack_bottom[stack_size],
+            stack_size);
 
 Review comment:
   maybe we could do os_arch_task_stack_init(t, t->stacktop, t->stacksize) as 
those are already set and imho it is cleaner when reading code
   
   Next step would be to end up only with os_arch_task_stack_init(t), but that 
requires more changes :) so it is ok to leave it for now.
 
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to