mirror of
https://github.com/tinygo-org/tinygo.git
synced 2026-08-14 07:53:40 +00:00
all: add the Boehm-Demers-Weiser GC on Linux
This adds support for the well-known Boehm GC. It's significantly faster than our own naive GC and could be used as an alternative on bigger systems. In the future, this GC might also be supported on WebAssembly with some extra work. Right now it's Linux only (though Windows/MacOS shouldn't be too difficult to add).
This commit is contained in:
committed by
Ron Evans
parent
a4cbe3326e
commit
3a7c25f987
@@ -534,6 +534,12 @@ func markRoots(start, end uintptr) {
|
||||
}
|
||||
}
|
||||
|
||||
func markCurrentGoroutineStack(sp uintptr) {
|
||||
// This could be optimized by only marking the stack area that's currently
|
||||
// in use.
|
||||
markRoot(0, sp)
|
||||
}
|
||||
|
||||
// stackOverflow is a flag which is set when the GC scans too deep while marking.
|
||||
// After it is set, all marked allocations must be re-scanned.
|
||||
var stackOverflow bool
|
||||
|
||||
Reference in New Issue
Block a user