MCPcopy Create free account
hub / github.com/0xShug0/audio.cpp / Get

Method Get

external/sentencepiece/src/util.cc:191–198  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

189 virtual ~RandomGeneratorStorage() { pthread_key_delete(key_); }
190
191 std::mt19937 *Get() {
192 auto *result = static_cast<std::mt19937 *>(pthread_getspecific(key_));
193 if (result == nullptr) {
194 result = new std::mt19937(GetRandomGeneratorSeed());
195 pthread_setspecific(key_, result);
196 }
197 return result;
198 }
199
200 private:
201 static void Delete(void *value) { delete static_cast<std::mt19937 *>(value); }

Callers 6

GetRandomGeneratorFunction · 0.80
GetCachedSizeFunction · 0.80
sentencepiece.pb.hFile · 0.80
GetCachedSizeFunction · 0.80
ByteSizeLongMethod · 0.80

Calls 1

GetRandomGeneratorSeedFunction · 0.85

Tested by

no test coverage detected