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

Method AddChunk

rapidjson/allocators.h:259–271  ·  view source on GitHub ↗

Creates a new chunk. ! \param capacity Capacity of the chunk in bytes. \return true if success. */

Source from the content-addressed store, hash-verified

257 \return true if success.
258 */
259 bool AddChunk(size_t capacity) {
260 if (!baseAllocator_)
261 ownBaseAllocator_ = baseAllocator_ = RAPIDJSON_NEW(BaseAllocator());
262 if (ChunkHeader* chunk = reinterpret_cast<ChunkHeader*>(baseAllocator_->Malloc(RAPIDJSON_ALIGN(sizeof(ChunkHeader)) + capacity))) {
263 chunk->capacity = capacity;
264 chunk->size = 0;
265 chunk->next = chunkHead_;
266 chunkHead_ = chunk;
267 return true;
268 }
269 else
270 return false;
271 }
272
273 static const int kDefaultChunkCapacity = 64 * 1024; //!< Default chunk capacity.
274

Callers

nothing calls this directly

Calls 1

MallocMethod · 0.45

Tested by

no test coverage detected