mirror of
https://github.com/tinygo-org/tinygo.git
synced 2026-08-04 11:07:46 +00:00
a683881eb7
Follow returned pointer aliases when deciding whether runtime.alloc calls can be lowered to stack allocations. A returned parameter is not the same as nocapture: it still flows back to the caller and must be checked as an alias of the original allocation. Keep the analysis conservative for recursive returned-parameter chains and unknown operands. The existing golden test now shows that the non-escaping returned pointer cases no longer require heap allocation.
13 lines
955 B
Plaintext
13 lines
955 B
Plaintext
testdata/allocs2.go:21:12: object allocated on the heap: escapes at line 22
|
|
testdata/allocs2.go:24:15: object allocated on the heap: size is not constant
|
|
testdata/allocs2.go:26:12: object allocated on the heap: object size 300 exceeds maximum stack allocation size 256
|
|
testdata/allocs2.go:29:12: object allocated on the heap: escapes at line 30
|
|
testdata/allocs2.go:36:21: object allocated on the heap: escapes at line 37
|
|
testdata/allocs2.go:44:22: object allocated on the heap: escapes at line 44
|
|
testdata/allocs2.go:46:13: object allocated on the heap: escapes at line 47
|
|
testdata/allocs2.go:49:2: object allocated on the heap: escapes at line 51
|
|
testdata/allocs2.go:50:2: object allocated on the heap: escapes at line 51
|
|
testdata/allocs2.go:107:11: object allocated on the heap: escapes at line 108
|
|
testdata/allocs2.go:114:2: object allocated on the heap: escapes at line 117
|
|
testdata/allocs2.go:128:2: object allocated on the heap: escapes at line 130
|