Taking a page from core git's strbuf, this introduces git_buf_initbuf which is an empty string that is used to initialize the git_buf ptr value even for new buffers. Now the git_buf ptr will always point to a valid NUL-terminated string. This change required jumping through a few hoops for git_buf_grow and git_buf_free to distinguish between a actual allocated buffer and the global initial value. Also, this moves the allocation related functions to be next to each other near the top of buffer.c.
Name |
Last commit
|
Last update |
---|---|---|
.. | ||
buf | Loading commit data... | |
config | Loading commit data... | |
core | Loading commit data... | |
index | Loading commit data... | |
network | Loading commit data... | |
object | Loading commit data... | |
odb | Loading commit data... | |
repo | Loading commit data... | |
status | Loading commit data... | |
README.md | Loading commit data... | |
clay | Loading commit data... | |
clay.h | Loading commit data... | |
clay_libgit2.h | Loading commit data... | |
clay_main.c | Loading commit data... |