MCPcopy Create free account
hub / github.com/golang/mobile / cString

Method cString

gl/work.go:158–161  ·  view source on GitHub ↗

cString creates C string off the Go heap. ret is a *char.

(str string)

Source from the content-addressed store, hash-verified

156// cString creates C string off the Go heap.
157// ret is a *char.
158func (ctx *context) cString(str string) (uintptr, func()) {
159 ptr := unsafe.Pointer(C.CString(str))
160 return uintptr(ptr), func() { C.free(ptr) }
161}
162
163// cStringPtr creates a pointer to a C string off the Go heap.
164// ret is a **char.

Callers 7

BindAttribLocationMethod · 0.95
GetAttribLocationMethod · 0.95
GetUniformLocationMethod · 0.95
BindAttribLocationMethod · 0.95
GetAttribLocationMethod · 0.95
GetUniformLocationMethod · 0.95
cStringPtrMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected