-
谢谢你的时间。。 |
Beta Was this translation helpful? Give feedback.
Answered by
hshq
Feb 2, 2024
Replies: 2 comments
-
|
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
daiwhea
-
多谢,问题 1 是我混淆了 fn 返回的处理。 |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
res 在栈中,这符合没有隐式内存分配的原则;也因此返回后自然会无效;
返回的是 T 类型,不是 *T ,T 的内容整个拷贝返回了,销毁不存在问题。
sliceAsBytes 需要切片,所以用 [1]T 而不是 T 是很自然的做法吧。