libgit2

git_odb_backend_data_alloc

Version:

Allocate data for an ODB object. Custom ODB backends may use this to provide data back to the ODB from their read function. This memory should not be freed once it is returned to libgit2. If a custom ODB uses this function but encounters an error and does not return this data to libgit2, then they should use the corresponding git_odb_backend_data_free function.

Signature

void *git_odb_backend_data_alloc(git_odb_backend *backend, size_t len);

Parameters

In
backend

the ODB backend that is allocating this memory

size_t
In
len

the number of bytes to allocate

Returns

void *

the allocated buffer on success or NULL if out of memory

Versions