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

Function table_clear

src/simulate/runtime_table.cpp:58–66  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

56 }
57
58 void table_clear ( Context & context, Table & arr, LineInfo * at ) {
59 if ( arr.isLocked() ) context.throw_error_at(at, "can't clear locked table");
60 if ( arr.data ) {
61 memset(arr.hashes, 0, arr.capacity*tableHashSlotBytes(arr));
62 memset(arr.data, 0, arr.keys - arr.data);
63 }
64 arr.size = 0;
65 arr.tombstones = 0;
66 }
67
68 void table_lock ( Context & context, Table & arr, LineInfo * at ) {
69 if ( arr.shared || arr.hopeless ) return;

Callers 2

scanTableMethod · 0.85
builtin_table_clearFunction · 0.85

Calls 3

tableHashSlotBytesFunction · 0.85
isLockedMethod · 0.80
throw_error_atMethod · 0.80

Tested by

no test coverage detected