compiler,runtime: implement a portable conservative GC

This commit is contained in:
Ayke van Laethem
2019-05-14 15:18:05 +02:00
parent 00e91ec569
commit 385d1d0a5d
12 changed files with 528 additions and 17 deletions
+13
View File
@@ -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)
}