mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
Correct _cgo_free when C ABI does not pass first arg on stack.
It turns out that _cgo_malloc is used, via cmalloc in runtime/cgocall.c, which is called by code generated by out.go for the ·_C_CString function. I can't find a call to _cgo_free, but given _cgo_malloc we might as well keep _cgo_free. This patch fixes it so that it should work on amd64. R=rsc CC=golang-dev https://golang.org/cl/1399041
This commit is contained in:
parent
a63f73c196
commit
1192c175fe
2 changed files with 13 additions and 2 deletions
|
|
@ -568,7 +568,7 @@ const cProlog = `
|
|||
#pragma dynimport libcgo_thread_start libcgo_thread_start "%s/libcgo.so"
|
||||
#pragma dynimport libcgo_set_scheduler libcgo_set_scheduler "%s/libcgo.so"
|
||||
#pragma dynimport _cgo_malloc _cgo_malloc "%s/libcgo.so"
|
||||
#pragma dynimport _cgo_free free "%s/libcgo.so"
|
||||
#pragma dynimport _cgo_free _cgo_free "%s/libcgo.so"
|
||||
|
||||
void
|
||||
·_C_GoString(int8 *p, String s)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue