diff options
| author | Edward Thomson <ethomson@edwardthomson.com> | 2019-02-23 18:40:43 +0000 |
|---|---|---|
| committer | Edward Thomson <ethomson@edwardthomson.com> | 2019-02-23 18:40:43 +0000 |
| commit | 790aae778df9bf4809e3c1e772d4d948c1cc2aa3 (patch) | |
| tree | 2a60af5b591787527c22aca2921f5ab7189aa2f1 /src/odb.c | |
| parent | 5a6a3c00acbd42038b50d830c7dd4a0c5c52052c (diff) | |
| download | libgit2-790aae778df9bf4809e3c1e772d4d948c1cc2aa3.tar.gz | |
odb: rename git_odb_backend_malloc for consistency
The `git_odb_backend_malloc` name is a system function that is provided
for custom ODB backends and allows them to allocate memory for an ODB
object in the read callback. This is important so that libgit2 can
later free the memory used by an ODB object that was read from the
custom backend.
However, the name _suggests_ that it actually allocates a
`git_odb_backend`. It does not; rename it to make it clear that it
actually allocates backend _data_.
Diffstat (limited to 'src/odb.c')
| -rw-r--r-- | src/odb.c | 7 |
1 files changed, 6 insertions, 1 deletions
@@ -1497,12 +1497,17 @@ int git_odb_write_pack(struct git_odb_writepack **out, git_odb *db, git_indexer_ return error; } -void *git_odb_backend_malloc(git_odb_backend *backend, size_t len) +void *git_odb_backend_data_alloc(git_odb_backend *backend, size_t len) { GIT_UNUSED(backend); return git__malloc(len); } +void *git_odb_backend_malloc(git_odb_backend *backend, size_t len) +{ + return git_odb_backend_data_alloc(backend, len); +} + int git_odb_refresh(struct git_odb *db) { size_t i; |
