git_odb_backend_data_alloc

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.

package extern (C) nothrow @nogc
void*
git_odb_backend_data_alloc

Parameters

backend .git_odb_backend*

the ODB backend that is allocating this memory

len size_t

the number of bytes to allocate

Return Value

Type: void*

the allocated buffer on success or NULL if out of memory

Meta