mirror of
https://github.com/tinygo-org/tinygo.git
synced 2026-09-10 14:39:31 +00:00
test: reduce AVR map memory pressure
This commit is contained in:
Vendored
+9
-2
@@ -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
|
||||||
|
|||||||
Reference in New Issue
Block a user