test: reduce AVR map memory pressure

This commit is contained in:
Jake Bailey
2026-08-07 13:35:11 -07:00
committed by Ron Evans
parent 160372b93a
commit ede501ae2b
+9 -2
View File
@@ -123,8 +123,15 @@ func main() {
println(`structMap[{"tau", 6.28}]:`, structMap[namedFloat{"tau", 6.28}]) println(`structMap[{"tau", 6.28}]:`, structMap[namedFloat{"tau", 6.28}])
// test preallocated map // test preallocated map
squares := make(map[int]int, 200) mapSize := 200
testBigMap(squares, 100) mapEntries := 100
if unsafe.Sizeof(uintptr(0)) < 4 {
// Leave enough heap for the rest of this test on low-memory devices.
mapSize = 100
mapEntries = 50
}
squares := make(map[int]int, mapSize)
testBigMap(squares, mapEntries)
println("tested preallocated map") println("tested preallocated map")
// test growing maps // test growing maps