You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I don't think it makes sense to have a malloc wrapper that returns a Go type instead of a C type.
Instead, push the malloc call to the caller side (where they will be prompted to consider when to free the data) and use unsafe.Slice to wrap it as a Go slice.
I propose a new helper
C.CArray
, similar toC.CString
/C.CBytes
, implemented as follows:I'm not quite sure what the implementation would look like inside
cmd/cgo
, so perhaps its better to add this method to thecgo
package instead.The text was updated successfully, but these errors were encountered: