(c *Cache, k K, v *T)
| 74 | } |
| 75 | |
| 76 | func setCacheOf[T any, K keyType](c *Cache, k K, v *T) { |
| 77 | typstr := reflect.ValueOf(v).Type().String() |
| 78 | typ := cacheTypesMap[typstr] |
| 79 | if typ == 0 { |
| 80 | return |
| 81 | } |
| 82 | key := uint64(typ)<<32 | uint64(k) |
| 83 | c.m.Store(key, unsafe.Pointer(v)) |
| 84 | } |
| 85 | |
| 86 | func getCacheOf[T any, K keyType](c *Cache, k K) (v *T, ok bool) { |
| 87 | typstr := reflect.ValueOf(v).Type().String() |
no test coverage detected