MCPcopy Create free account
hub / github.com/Vector35/binaryninja-api / Expand

Method Expand

rapidjson/internal/stack.h:181–197  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

179private:
180 template<typename T>
181 void Expand(size_t count) {
182 // Only expand the capacity if the current stack exists. Otherwise just create a stack with initial capacity.
183 size_t newCapacity;
184 if (stack_ == 0) {
185 if (!allocator_)
186 ownAllocator_ = allocator_ = RAPIDJSON_NEW(Allocator());
187 newCapacity = initialCapacity_;
188 } else {
189 newCapacity = GetCapacity();
190 newCapacity += (newCapacity + 1) / 2;
191 }
192 size_t newSize = GetSize() + sizeof(T) * count;
193 if (newCapacity < newSize)
194 newCapacity = newSize;
195
196 Resize(newCapacity);
197 }
198
199 void Resize(size_t newCapacity) {
200 const size_t size = GetSize(); // Backup the current size

Callers

nothing calls this directly

Calls 1

GetSizeFunction · 0.50

Tested by

no test coverage detected