BUF_RESERVE(3) - Library Functions Manual
buf_reserve - allocate more storage for next operations
buf_reserve(struct buf *b, size_t desired);
The buf_reserve() function tries to increase the buffer’s capacity specified by b to the amount of desired.
Once the new capacity is increased the next calls to any operation that would append data to the buffer can avoid reallocating the memory. This can be useful if you know in advance which storage space you need.
If it was unable to acquire more memory, the buffer still contains the original data and capacity remains unchanged. In any case, the buffer length’s remains unchanged and only capacity is increased.
The buf_reserve() function returns false in case of error and errno is set to indicate the error.
Couldn’t allocate more memory.
The libbuf library was written by David Demelier <firstname.lastname@example.org>
macOS 11.2 - October 29, 2019-2020