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
f4b473fa
Unverified
Commit
f4b473fa
authored
Dec 20, 2020
by
Edward Thomson
Committed by
GitHub
Dec 20, 2020
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #5746 from libgit2/ethomson/configmapcache
repository: use intptr_t's in the config map cache
parents
70ed3087
1b708683
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
6 deletions
+9
-6
src/config_cache.c
+8
-5
src/repository.h
+1
-1
No files found.
src/config_cache.c
View file @
f4b473fa
...
...
@@ -111,18 +111,21 @@ int git_config__configmap_lookup(int *out, git_config *config, git_configmap_ite
int
git_repository__configmap_lookup
(
int
*
out
,
git_repository
*
repo
,
git_configmap_item
item
)
{
*
out
=
(
int
)
(
intptr_t
)
git_atomic_load
(
repo
->
configmap_cache
[(
int
)
item
]);
intptr_t
value
=
(
intptr_t
)
git_atomic_load
(
repo
->
configmap_cache
[(
int
)
item
]);
if
(
*
out
==
GIT_CONFIGMAP_NOT_CACHED
)
{
int
error
;
int
oldval
=
GIT_CONFIGMAP_NOT_CACHED
;
*
out
=
(
int
)
value
;
if
(
value
==
GIT_CONFIGMAP_NOT_CACHED
)
{
git_config
*
config
;
intptr_t
oldval
=
value
;
int
error
;
if
((
error
=
git_repository_config__weakptr
(
&
config
,
repo
))
<
0
||
(
error
=
git_config__configmap_lookup
(
out
,
config
,
item
))
<
0
)
return
error
;
git_atomic_compare_and_swap
(
&
repo
->
configmap_cache
[(
int
)
item
],
&
oldval
,
out
);
value
=
*
out
;
git_atomic_compare_and_swap
(
&
repo
->
configmap_cache
[(
int
)
item
],
(
void
*
)
oldval
,
(
void
*
)
value
);
}
return
0
;
...
...
src/repository.h
View file @
f4b473fa
...
...
@@ -154,7 +154,7 @@ struct git_repository {
git_atomic32
attr_session_key
;
git_configmap_value
configmap_cache
[
GIT_CONFIGMAP_CACHE_MAX
];
intptr_t
configmap_cache
[
GIT_CONFIGMAP_CACHE_MAX
];
git_strmap
*
submodule_cache
;
};
...
...
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