BufReserve
Description
Ensure b has capacity for at least n bytes without changing its length. Allocates only when the existing capacity is below n.
Success
Returns true; b->data may have moved.
Failure
Returns false if the underlying allocator fails to grow the buffer; *b is unchanged.
Usage example (Cross-references)
Usage examples (Cross-references)
- In
Pdb.c:739:
}
Buf copy = BufInit(alloc);
if (!BufReserve(©, (u64)data_size)) {
LOG_ERROR("PdbOpenFromMemoryCopy: allocation failed ({} bytes)", (u64)data_size);
return false;- In
Pe.c:539:
}
Buf copy = BufInit(alloc);
if (!BufReserve(©, (u64)data_size)) {
LOG_ERROR("PeOpenFromMemoryCopy: allocation failed ({} bytes)", (u64)data_size);
return false;
Last updated on