MCPcopy Create free account
hub / github.com/deathkiller/jazz2-native / destruct

Method destruct

Sources/Shared/Containers/String.cpp:84–92  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

82 }
83
84 inline void String::destruct() {
85 // If not SSO, delete the data
86 if (_small.size & Implementation::SmallStringBit) return;
87 // Instances created with a custom deleter either don't the Global bit set at all, or have it set but the deleter
88 // is a no-op passed from nullTerminatedView() / nullTerminatedGlobalView(). Thus *technically* it's not needed to clear
89 // the LargeSizeMask (which implies there's also no way to test that it got cleared), but do it for consistency.
90 if (_large.deleter) _large.deleter(_large.data, _large.size & ~LargeSizeMask);
91 else delete[] _large.data;
92 }
93
94 inline String::Data String::dataInternal() const {
95 if (_small.size & Implementation::SmallStringBit)

Callers

nothing calls this directly

Calls 1

deleterMethod · 0.45

Tested by

no test coverage detected