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

Method afterTable

src/simulate/simulate_gc.cpp:1132–1147  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1130 }
1131 }
1132 virtual void afterTable ( Table * pa, TypeInfo * ti ) override {
1133 if ( pa->data ) {
1134 if ( !pa->isLocked() || pa->hopeless ) {
1135 uint64_t oldSize = pa->capacity*uint64_t(ti->firstType->size+ti->secondType->size) + pa->capacity*tableHashSlotBytes(*pa);
1136 __context__->free(pa->data, oldSize, __at__);
1137 } else {
1138 __context__->throw_error_at(__at__, "can't delete locked table");
1139 }
1140 if ( pa->hopeless ) {
1141 memset ( pa, 0, sizeof(Table) );
1142 pa->hopeless = true;
1143 } else {
1144 memset ( pa, 0, sizeof(Table) );
1145 }
1146 }
1147 }
1148 };
1149
1150 vec4f builtin_collect_local_and_zero ( Context & context, SimNode_CallBase * call, vec4f * args ) {

Callers

nothing calls this directly

Calls 4

tableHashSlotBytesFunction · 0.85
isLockedMethod · 0.80
throw_error_atMethod · 0.80
freeMethod · 0.45

Tested by

no test coverage detected