esp32: remove dead code and fix GC root scanning

Remove unused cpuIntUsed and cpuIntToPeripheral variables from
interrupt_esp32.go because these were declared but never read.

Fix _globals_end in the linker script to cover .data in addition to
.bss and .wifi_bss. Previously the GC scan range ended at
_wifi_bss_end, missing any heap pointers stored in initialized
globals (.data section). Extend to _edata so the conservative
collector sees all global root pointers.

Signed-off-by: deadprogram <ron@hybridgroup.com>
This commit is contained in:
deadprogram
2026-07-20 16:41:51 +02:00
committed by Ron Evans
parent 6aa966af0a
commit fc17c3565e
2 changed files with 1 additions and 11 deletions
-10
View File
@@ -53,13 +53,6 @@ const (
lastCPUInt = 30
)
// cpuIntUsed tracks which CPU interrupt lines have been allocated.
var cpuIntUsed [32]bool
// cpuIntToPeripheral maps CPU interrupt number → peripheral IRQ source,
// so that handleInterrupt can dispatch to the correct Go handler.
var cpuIntToPeripheral [32]int
// inInterrupt is set while we're inside the interrupt handler so that
// interrupt.In() returns the correct value.
var inInterrupt bool
@@ -75,9 +68,6 @@ func (i Interrupt) Enable() error {
return errInterruptRange
}
// Mark as used.
cpuIntUsed[i.num] = true
// Read current INTENABLE, set the bit for this CPU interrupt.
cur := readINTENABLE()
cur |= 1 << uint(i.num)
+1 -1
View File
@@ -185,7 +185,7 @@ SECTIONS
/* For the garbage collector. */
_globals_start = _sbss;
_globals_end = _wifi_bss_end;
_globals_end = _edata;
_heap_start = _edata;
/* Go GC heap = the rest of SRAM2 above .data (~113KB), a single safe contiguous
* block. The WiFi arena lives in DRAM1 (SRAM1 pool 7/6), so its ~64KB does not