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)
| 369 | // If C stores the string, it must be pinned explicitly instead (inefficient). |
| 370 | // C may never modify the string. |
| 371 | func 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 |
| 376 | func newPersistentZendString(str string) *C.zend_string { |
no outgoing calls
no test coverage detected