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
func alloc(size uintptr, layout unsafe.Pointer) unsafe.Pointer
func realloc(ptr unsafe.Pointer, size uintptr) unsafe.Pointer
@@ -38,3 +40,7 @@ func initHeap() {
func setHeapEnd(newHeapEnd uintptr) {
// Nothing to do here, this function is never actually called.
}
func markRoots(start, end uintptr) {
// dummy, so that markGlobals will compile
}