avr: use a garbage collector

This might sound crazy, but I think it's better to enable the GC by
default to avoid surprises. It costs 1130 bytes of flash and 16 bytes of
RAM (plus heap overhead) so it's not exactly free, but if needed it can
easily be disabled with `-gc=leaking`. On the Uno (32kB flash, 2kB RAM)
that's not massive, on the DigiSpark (8kB flash, 0.5kB RAM) that may be
too much depending on the application.
This commit is contained in:
Ayke van Laethem
2020-01-25 23:50:57 +01:00
committed by Ron Evans
parent 6e26728391
commit 15c7d93ea9
6 changed files with 24 additions and 4 deletions
+1 -1
View File
@@ -318,7 +318,7 @@ func markRoots(start, end uintptr) {
}
}
for addr := start; addr != end; addr += unsafe.Sizeof(addr) {
for addr := start; addr != end; addr += unsafe.Alignof(addr) {
root := *(*uintptr)(unsafe.Pointer(addr))
markRoot(addr, root)
}