Some accessor reflect.Value methods must allocate since they return value that references an underlying value that must be heap allocated.
Such patterns include:
v1.Set(v2.MapIndex(...))
v1.Set(v2.Slice(...))
v1.Set(v2.Slice3(...))
In such a usage, the generated value could be stack allocated since it only used as an intermediate storage before the value is stored into v1.
Some accessor
reflect.Valuemethods must allocate since they return value that references an underlying value that must be heap allocated.Such patterns include:
In such a usage, the generated value could be stack allocated since it only used as an intermediate storage before the value is stored into
v1.