2021-04-26 13:52:50 +02:00
|
|
|
package vips
|
2019-06-06 12:51:29 +02:00
|
|
|
|
|
|
|
import "C"
|
|
|
|
|
|
|
|
var cStringsCache = make(map[string]*C.char)
|
|
|
|
|
|
|
|
func cachedCString(str string) *C.char {
|
|
|
|
if cstr, ok := cStringsCache[str]; ok {
|
|
|
|
return cstr
|
|
|
|
}
|
|
|
|
|
|
|
|
cstr := C.CString(str)
|
|
|
|
cStringsCache[str] = cstr
|
|
|
|
|
|
|
|
return cstr
|
|
|
|
}
|