summaryrefslogtreecommitdiff
path: root/src/pack.c
diff options
context:
space:
mode:
authorEdward Thomson <ethomson@edwardthomson.com>2020-12-05 15:26:59 +0000
committerEdward Thomson <ethomson@edwardthomson.com>2020-12-06 01:08:22 +0000
commit37763d38fbf5db932be8d6a0070255839e7719ca (patch)
tree4eee46a0f689872fc4b8440e91ff82ec0ee3b154 /src/pack.c
parent9800728a746b872fdd22db9e68bc85ef0c851f27 (diff)
downloadlibgit2-37763d38fbf5db932be8d6a0070255839e7719ca.tar.gz
threads: rename git_atomic to git_atomic32
Clarify the `git_atomic` type and functions now that we have a 64 bit version as well (`git_atomic64`).
Diffstat (limited to 'src/pack.c')
-rw-r--r--src/pack.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/pack.c b/src/pack.c
index b88c52acf..a9140c63d 100644
--- a/src/pack.c
+++ b/src/pack.c
@@ -57,7 +57,7 @@ static git_pack_cache_entry *new_cache_object(git_rawobj *source)
if (!e)
return NULL;
- git_atomic_inc(&e->refcount);
+ git_atomic32_inc(&e->refcount);
memcpy(&e->raw, source, sizeof(git_rawobj));
return e;
@@ -114,7 +114,7 @@ static git_pack_cache_entry *cache_get(git_pack_cache *cache, off64_t offset)
return NULL;
if ((entry = git_offmap_get(cache->entries, offset)) != NULL) {
- git_atomic_inc(&entry->refcount);
+ git_atomic32_inc(&entry->refcount);
entry->last_usage = cache->use_ctr++;
}
git_mutex_unlock(&cache->lock);
@@ -129,7 +129,7 @@ static void free_lowest_entry(git_pack_cache *cache)
git_pack_cache_entry *entry;
git_offmap_foreach(cache->entries, offset, entry, {
- if (entry && git_atomic_get(&entry->refcount) == 0) {
+ if (entry && git_atomic32_get(&entry->refcount) == 0) {
cache->memory_used -= entry->raw.len;
git_offmap_delete(cache->entries, offset);
free_cache_object(entry);
@@ -759,7 +759,7 @@ int git_packfile_unpack(
GIT_ERROR_CHECK_ALLOC(obj->data);
memcpy(obj->data, data, obj->len + 1);
- git_atomic_dec(&cached->refcount);
+ git_atomic32_dec(&cached->refcount);
goto cleanup;
}
@@ -807,7 +807,7 @@ int git_packfile_unpack(
}
if (cached) {
- git_atomic_dec(&cached->refcount);
+ git_atomic32_dec(&cached->refcount);
cached = NULL;
}
@@ -821,7 +821,7 @@ cleanup:
if (error < 0) {
git__free(obj->data);
if (cached)
- git_atomic_dec(&cached->refcount);
+ git_atomic32_dec(&cached->refcount);
}
if (elem)