| ▲ | matthewaveryusa 4 days ago | |
Nope, this analysis is wrong. Decompile your code and look at what's going on: https://godbolt.org/z/f1nx9ffYK The thing being returned is a slice (a fat pointer) that has pointer, length, capacity. In the code linked you'll see the fat pointer being returned from the function as values. in C you'd get just AX (the pointer, without length and cap)
The gargabe collection is happening in the FUNCDATA/PCDATA annotations, but I don't really know how that works. | ||