mirror of
https://github.com/git-for-windows/git.git
synced 2026-06-24 03:34:47 -05:00
pack-objects: drop the two tree-walk casts in the preferred-base path
With init_tree_desc() widened in the prior commit, the size_t-returning odb_read_object_peeled() call in add_preferred_base() and odb_read_object() call in pbase_tree_get() can both flow straight through to init_tree_desc() and into the pbase_tree_cache. Widen pbase_tree_cache.tree_size and the two local size variables to size_t, drop the size_st bridges, and drop the two cast_size_t_to_ulong() shims. This was the last pair of cast_size_t_to_ulong() call sites in builtin/pack-objects.c, completing the >4 GiB-objects work in that file that this branch and its predecessors have been pursuing. Assisted-by: Opus 4.7 Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
This commit is contained in:
@@ -1912,7 +1912,7 @@ struct pbase_tree_cache {
|
||||
int ref;
|
||||
int temporary;
|
||||
void *tree_data;
|
||||
unsigned long tree_size;
|
||||
size_t tree_size;
|
||||
};
|
||||
|
||||
static struct pbase_tree_cache *(pbase_tree_cache[256]);
|
||||
@@ -1939,8 +1939,7 @@ static struct pbase_tree_cache *pbase_tree_get(const struct object_id *oid)
|
||||
{
|
||||
struct pbase_tree_cache *ent, *nent;
|
||||
void *data;
|
||||
unsigned long size;
|
||||
size_t size_st = 0;
|
||||
size_t size;
|
||||
enum object_type type;
|
||||
int neigh;
|
||||
int my_ix = pbase_tree_cache_ix(oid);
|
||||
@@ -1968,8 +1967,7 @@ static struct pbase_tree_cache *pbase_tree_get(const struct object_id *oid)
|
||||
/* Did not find one. Either we got a bogus request or
|
||||
* we need to read and perhaps cache.
|
||||
*/
|
||||
data = odb_read_object(the_repository->objects, oid, &type, &size_st);
|
||||
size = cast_size_t_to_ulong(size_st);
|
||||
data = odb_read_object(the_repository->objects, oid, &type, &size);
|
||||
if (!data)
|
||||
return NULL;
|
||||
if (type != OBJ_TREE) {
|
||||
@@ -2123,16 +2121,14 @@ static void add_preferred_base(struct object_id *oid)
|
||||
{
|
||||
struct pbase_tree *it;
|
||||
void *data;
|
||||
unsigned long size;
|
||||
size_t size_st = 0;
|
||||
size_t size;
|
||||
struct object_id tree_oid;
|
||||
|
||||
if (window <= num_preferred_base++)
|
||||
return;
|
||||
|
||||
data = odb_read_object_peeled(the_repository->objects, oid,
|
||||
OBJ_TREE, &size_st, &tree_oid);
|
||||
size = cast_size_t_to_ulong(size_st);
|
||||
OBJ_TREE, &size, &tree_oid);
|
||||
if (!data)
|
||||
return;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user