MCPcopy Create free account
hub / github.com/apache/impala / STLClearIfBig

Function STLClearIfBig

be/src/gutil/stl_util.h:87–93  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

85// Reduce memory usage on behalf of object if its capacity is greater
86// than or equal to "limit", which defaults to 2^20.
87template <class T> inline void STLClearIfBig(T* obj, size_t limit = 1<<20) {
88 if (obj->capacity() >= limit) {
89 STLClearObject(obj);
90 } else {
91 obj->clear();
92 }
93}
94
95// Specialization for deque, which doesn't implement capacity().
96template <class T, class A>

Callers

nothing calls this directly

Calls 4

STLClearObjectFunction · 0.85
clearMethod · 0.65
capacityMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected