windows: scan globals conservatively

Scan globals conservatively by reading writable sections from the PE
header.

I'd like to get rid of needing to precisely scan globals eventually, and
this brings us one step closer. It also avoids a bug with ThinLTO on
Windows.
This commit is contained in:
Ayke van Laethem
2022-05-22 22:56:49 +02:00
committed by Ron Evans
parent b52310fed2
commit 5404c81ffd
4 changed files with 103 additions and 2 deletions
+6
View File
@@ -11,6 +11,8 @@ import (
"unsafe"
)
const gcAsserts = false // perform sanity checks
// Ever-incrementing pointer: no memory is freed.
var heapptr = heapStart
@@ -76,3 +78,7 @@ func setHeapEnd(newHeapEnd uintptr) {
// enough.
heapEnd = newHeapEnd
}
func markRoots(start, end uintptr) {
// dummy, so that markGlobals will compile
}