Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
git2
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
lvzhengyang
git2
Commits
7a3fc9fb
Commit
7a3fc9fb
authored
Sep 06, 2012
by
Vicent Martí
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #900 from pwkelley/development
Expose a malloc function to 3rd party ODB backends
parents
4e2b8b4c
c49d328c
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
0 deletions
+11
-0
include/git2/odb_backend.h
+6
-0
src/odb.c
+5
-0
No files found.
include/git2/odb_backend.h
View file @
7a3fc9fb
...
...
@@ -26,6 +26,10 @@ struct git_odb_stream;
struct
git_odb_backend
{
git_odb
*
odb
;
/* read and read_prefix each return to libgit2 a buffer which
* will be freed later. The buffer should be allocated using
* the function git_odb_backend_malloc to ensure that it can
* be safely freed later. */
int
(
*
read
)(
void
**
,
size_t
*
,
git_otype
*
,
struct
git_odb_backend
*
,
...
...
@@ -102,6 +106,8 @@ GIT_EXTERN(int) git_odb_backend_pack(git_odb_backend **backend_out, const char *
GIT_EXTERN
(
int
)
git_odb_backend_loose
(
git_odb_backend
**
backend_out
,
const
char
*
objects_dir
,
int
compression_level
,
int
do_fsync
);
GIT_EXTERN
(
int
)
git_odb_backend_one_pack
(
git_odb_backend
**
backend_out
,
const
char
*
index_file
);
GIT_EXTERN
(
void
*
)
git_odb_backend_malloc
(
git_odb_backend
*
backend
,
size_t
len
);
GIT_END_DECL
#endif
src/odb.c
View file @
7a3fc9fb
...
...
@@ -708,6 +708,11 @@ int git_odb_open_rstream(git_odb_stream **stream, git_odb *db, const git_oid *oi
return
error
;
}
void
*
git_odb_backend_malloc
(
git_odb_backend
*
backend
,
size_t
len
)
{
return
git__malloc
(
len
);
}
int
git_odb__error_notfound
(
const
char
*
message
,
const
git_oid
*
oid
)
{
if
(
oid
!=
NULL
)
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment