Skip to content
Commit 8530cfa7 authored by Daniel Leung's avatar Daniel Leung Committed by Christopher Friedt
Browse files

kernel: mark z_current_get() as const



In commit 00f95032938e1387126f453b64f8c479987ca16e to make
k_current_get() work without syscall, a new z_current_get()
was introduced since there are times when thread local
storage has not been initialized. However, this was not
marked with const attribute the same as k_current_get().
This may result in slower compiled code as each call to
z_current_get() may actually need to go through the whole
function call process instead of reusing the result from
previous call in the same scope. So add const attribute
to z_current_get() to restore the old behavior.

Fixes #37460

Signed-off-by: default avatarDaniel Leung <daniel.leung@intel.com>
parent e444a9a0
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment