MCPcopy Create free account
hub / github.com/GaijinEntertainment/daScript / gc0_save_ptr

Function gc0_save_ptr

src/builtin/module_builtin_runtime.cpp:1412–1418  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1410 DAS_THREAD_LOCAL(TStaticStorage) g_static_storage;
1411
1412 void gc0_save_ptr ( char * name, void * data, Context * context, LineInfoArg * line ) {
1413 uint64_t hash = hash_function ( *context, name );
1414 if ( g_static_storage->find(hash)!=g_static_storage->end() ) {
1415 context->throw_error_at(line, "gc0 already there %s (or hash collision)", name);
1416 }
1417 (*g_static_storage)[hash] = data;
1418 }
1419
1420 void gc0_save_smart_ptr ( char * name, smart_ptr_raw<void> data, Context * context, LineInfoArg * line ) {
1421 gc0_save_ptr(name, data.get(), context, line);

Callers 1

gc0_save_smart_ptrFunction · 0.85

Calls 4

hash_functionFunction · 0.85
throw_error_atMethod · 0.80
findMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected