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 |
---|---|---|
.. | ||
buffer.c | Loading commit data... | |
dirent.c | Loading commit data... | |
filebuf.c | Loading commit data... | |
oid.c | Loading commit data... | |
path.c | Loading commit data... | |
rmdir.c | Loading commit data... | |
string.c | Loading commit data... | |
strtol.c | Loading commit data... | |
vector.c | Loading commit data... |