mirror of
https://github.com/tinygo-org/tinygo.git
synced 2026-09-15 08:52:57 +00:00
runtime: refactor obtaining the system stack
The system stack is only needed when we're not on it. So we can directly call task.SystemStack() without problems. This also saves a tiny bit of binary size.
This commit is contained in:
committed by
Ron Evans
parent
3a2188fc7b
commit
0c7c2926f9
@@ -1,17 +0,0 @@
|
||||
//go:build scheduler.tasks
|
||||
|
||||
package runtime
|
||||
|
||||
import "internal/task"
|
||||
|
||||
// getSystemStackPointer returns the current stack pointer of the system stack.
|
||||
// This is not necessarily the same as the current stack pointer.
|
||||
func getSystemStackPointer() uintptr {
|
||||
// TODO: this always returns the correct stack on Cortex-M, so don't bother
|
||||
// comparing against 0.
|
||||
sp := task.SystemStack()
|
||||
if sp == 0 {
|
||||
sp = getCurrentStackPointer()
|
||||
}
|
||||
return sp
|
||||
}
|
||||
Reference in New Issue
Block a user