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
a2378ae4
Commit
a2378ae4
authored
Apr 23, 2013
by
Vicent Marti
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
opts: Add getter for cached memory
parent
920cbc98
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
9 additions
and
3 deletions
+9
-3
include/git2/common.h
+2
-1
src/cache.c
+1
-2
src/cache.h
+1
-0
src/util.c
+5
-0
No files found.
include/git2/common.h
View file @
a2378ae4
...
...
@@ -133,7 +133,8 @@ enum {
GIT_OPT_SET_SEARCH_PATH
,
GIT_OPT_SET_CACHE_OBJECT_LIMIT
,
GIT_OPT_SET_CACHE_MAX_SIZE
,
GIT_OPT_ENABLE_CACHING
GIT_OPT_ENABLE_CACHING
,
GIT_OPT_GET_CACHED_MEMORY
};
/**
...
...
src/cache.c
View file @
a2378ae4
...
...
@@ -19,8 +19,7 @@ GIT__USE_OIDMAP
bool
git_cache__enabled
=
true
;
int64_t
git_cache__max_storage
=
(
256
*
1024
*
1024
);
static
git_atomic64
git_cache__current_storage
=
{
0
};
git_atomic64
git_cache__current_storage
=
{
0
};
static
size_t
git_cache__max_object_size
[
8
]
=
{
0
,
/* GIT_OBJ__EXT1 */
...
...
src/cache.h
View file @
a2378ae4
...
...
@@ -36,6 +36,7 @@ typedef struct {
extern
bool
git_cache__enabled
;
extern
int64_t
git_cache__max_storage
;
extern
git_atomic64
git_cache__current_storage
;
int
git_cache_set_max_object_size
(
git_otype
type
,
size_t
size
);
...
...
src/util.c
View file @
a2378ae4
...
...
@@ -109,6 +109,11 @@ int git_libgit2_opts(int key, ...)
case
GIT_OPT_ENABLE_CACHING
:
git_cache__enabled
=
(
va_arg
(
ap
,
int
)
!=
0
);
break
;
case
GIT_OPT_GET_CACHED_MEMORY
:
*
(
va_arg
(
ap
,
int64_t
*
))
=
git_cache__current_storage
.
val
;
*
(
va_arg
(
ap
,
int64_t
*
))
=
git_cache__max_storage
;
break
;
}
va_end
(
ap
);
...
...
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