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

Method pinString

phpthread.go:193–202  ·  view source on GitHub ↗

Pin a string that is not null-terminated PHP's zend_string may contain null-bytes

(s string)

Source from the content-addressed store, hash-verified

191// Pin a string that is not null-terminated
192// PHP's zend_string may contain null-bytes
193func (thread *phpThread) pinString(s string) *C.char {
194 sData := unsafe.StringData(s)
195 if sData == nil {
196 return nil
197 }
198
199 thread.Pin(sData)
200
201 return (*C.char)(unsafe.Pointer(sData))
202}
203
204// C strings must be null-terminated
205func (thread *phpThread) pinCString(s string) *C.char {

Callers 1

pinCStringMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected