Commit 2074c00
committed
kernel: speed up z_stack_space_get
The z_stack_space_get call currently checks for free space at the
top of the stack by checking each byte individually. This can
introduce significant runtime overhead for threads which have large,
mostly unused stacks. This change updates the check to first count
the free space by word, and then check the sub-word unused bytes.
Signed-off-by: Félix Turgeon <[email protected]>1 parent 3d4f83a commit 2074c00
1 file changed
+20
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
853 | 853 | | |
854 | 854 | | |
855 | 855 | | |
856 | | - | |
| 856 | + | |
| 857 | + | |
| 858 | + | |
| 859 | + | |
| 860 | + | |
| 861 | + | |
| 862 | + | |
| 863 | + | |
| 864 | + | |
| 865 | + | |
| 866 | + | |
| 867 | + | |
| 868 | + | |
| 869 | + | |
| 870 | + | |
| 871 | + | |
| 872 | + | |
| 873 | + | |
| 874 | + | |
| 875 | + | |
857 | 876 | | |
858 | 877 | | |
859 | 878 | | |
| |||
0 commit comments