MCPcopy Create free account
hub / github.com/imgproxy/imgproxy / cachedCString

Function cachedCString

vips/cached_c_strings.go:8–17  ·  view source on GitHub ↗
(str string)

Source from the content-addressed store, hash-verified

6var cStringsCache sync.Map
7
8func cachedCString(str string) *C.char {
9 if cstr, ok := cStringsCache.Load(str); ok {
10 return cstr.(*C.char) //nolint:forcetypeassert
11 }
12
13 cstr := C.CString(str)
14 cStringsCache.Store(str, cstr)
15
16 return cstr
17}

Callers 13

hasOperationFunction · 0.85
GetIntMethod · 0.85
GetIntDefaultMethod · 0.85
GetIntSliceMethod · 0.85
GetIntSliceDefaultMethod · 0.85
GetDoubleMethod · 0.85
GetDoubleDefaultMethod · 0.85
GetBlobMethod · 0.85
SetIntMethod · 0.85
SetIntSliceMethod · 0.85
SetDoubleMethod · 0.85
SetBlobMethod · 0.85

Calls 1

LoadMethod · 0.80

Tested by

no test coverage detected