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

Method afterArray

src/simulate/simulate_gc.cpp:1116–1131  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1114 return (ti->secondType->flags & gcFlags);
1115 }
1116 virtual void afterArray ( Array * pa, TypeInfo * ti ) override {
1117 if ( pa->data ) {
1118 if ( !pa->isLocked() || pa->hopeless ) {
1119 uint64_t oldSize = pa->capacity*ti->firstType->size;
1120 __context__->free(pa->data, oldSize, __at__);
1121 } else {
1122 __context__->throw_error_at(__at__, "can't delete locked array");
1123 }
1124 if ( pa->hopeless ) {
1125 memset ( pa, 0, sizeof(Array) );
1126 pa->hopeless = true;
1127 } else {
1128 memset ( pa, 0, sizeof(Array) );
1129 }
1130 }
1131 }
1132 virtual void afterTable ( Table * pa, TypeInfo * ti ) override {
1133 if ( pa->data ) {
1134 if ( !pa->isLocked() || pa->hopeless ) {

Callers

nothing calls this directly

Calls 3

isLockedMethod · 0.80
throw_error_atMethod · 0.80
freeMethod · 0.45

Tested by

no test coverage detected