MCPcopy Index your code
hub / github.com/php/frankenphp / toUnsafeChar

Function toUnsafeChar

cgi.go:371–373  ·  view source on GitHub ↗

toUnsafeChar returns a *C.char pointing at the backing bytes the Go string. If C does not store the string, it may be passed directly in a Cgo call (most efficient). If C stores the string, it must be pinned explicitly instead (inefficient). C may never modify the string.

(s string)

Source from the content-addressed store, hash-verified

369// If C stores the string, it must be pinned explicitly instead (inefficient).
370// C may never modify the string.
371func toUnsafeChar(s string) *C.char {
372 return (*C.char)(unsafe.Pointer(unsafe.StringData(s)))
373}
374
375// initialize a global zend_string that must never be freed and is ignored by GC
376func newPersistentZendString(str string) *C.zend_string {

Callers 5

addHeadersToServerFunction · 0.85
addPreparedEnvToServerFunction · 0.85
newPersistentZendStringFunction · 0.85
phpArrayFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected