that's the problem, i use c just like an channel, the value final send to
other language. i know i can make an call back function in c and then
release that memory in c code.
regrettably, this will take many time and i don;t have so much.
however ,thx
在2020年11月18日星期三 UTC+8 上午10:43:20 写道:
> On
On Tue, Nov 17, 2020 at 6:38 PM 杜仲 wrote:
>
> my go version is 1.13.
> i used cgo.cstring in my func, and the func will return cstring.
> i don't know when c complete work about the cstring memory.
> if i used defer c.free to release the cstring memory, the cstring val will
> change and return a
my go version is 1.13.
i used cgo.cstring in my func, and the func will return cstring.
i don't know when c complete work about the cstring memory.
if i used defer c.free to release the cstring memory, the cstring val will
change and return a unexpected value, especially at often apply memory on