MCPcopy Create free account
hub / github.com/bytedance/bolt / maybePushBack

Method maybePushBack

bolt/vector/VectorPool.cpp:101–114  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

99}
100
101bool VectorPool::TypePool::maybePushBack(VectorPtr& vector) {
102 // Check that this is a Flat Vector with an initialized, unique, and mutable
103 // values Buffer and an uninitialized or unique and mutable nulls Buffer.
104 if (!vector->isWritable() || !vector->isFlatEncoding() || !vector->values()) {
105 return false;
106 }
107 if (size >= kNumPerType) {
108 return false;
109 }
110
111 vector->prepareForReuse();
112 vectors[size++] = std::move(vector);
113 return true;
114}
115
116VectorPtr VectorPool::TypePool::pop(
117 const TypePtr& type,

Callers 1

releaseMethod · 0.80

Calls 3

isWritableMethod · 0.45
valuesMethod · 0.45
prepareForReuseMethod · 0.45

Tested by

no test coverage detected