mirror of
https://github.com/tinygo-org/tinygo.git
synced 2026-08-06 20:13:40 +00:00
compiler,runtime: implement a portable conservative GC
This commit is contained in:
@@ -0,0 +1,13 @@
|
||||
// +build gc.conservative
|
||||
// +build cortexm
|
||||
|
||||
package runtime
|
||||
|
||||
// markStack marks all root pointers found on the stack.
|
||||
//
|
||||
// This implementation is conservative and relies on the stack top (provided by
|
||||
// the linker) and getting the current stack pointer from a register. Also, it
|
||||
// assumes a descending stack. Thus, it is not very portable.
|
||||
func markStack() {
|
||||
markRoots(getCurrentStackPointer(), stackTop)
|
||||
}
|
||||
Reference in New Issue
Block a user