mirror of
https://github.com/borgbackup/borg.git
synced 2024-12-24 00:37:56 +00:00
hashindex: Fix issue with indicies larger than 2GB
This commit is contained in:
parent
5c699b30a7
commit
7e15abd29c
1 changed files with 3 additions and 3 deletions
|
@ -33,10 +33,10 @@ typedef struct {
|
||||||
int num_buckets;
|
int num_buckets;
|
||||||
int key_size;
|
int key_size;
|
||||||
int value_size;
|
int value_size;
|
||||||
int bucket_size;
|
off_t bucket_size;
|
||||||
int lower_limit;
|
int lower_limit;
|
||||||
int upper_limit;
|
int upper_limit;
|
||||||
int data_len;
|
off_t data_len;
|
||||||
} HashIndex;
|
} HashIndex;
|
||||||
|
|
||||||
#define MAGIC "ATTICIDX"
|
#define MAGIC "ATTICIDX"
|
||||||
|
@ -213,7 +213,7 @@ hashindex_init(int capacity, int key_size, int value_size)
|
||||||
EPRINTF("malloc failed");
|
EPRINTF("malloc failed");
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
index->data_len = sizeof(HashHeader) + capacity * (key_size + value_size);
|
index->data_len = sizeof(HashHeader) + (off_t)capacity * (key_size + value_size);
|
||||||
if(!(index->data = calloc(index->data_len, 1))) {
|
if(!(index->data = calloc(index->data_len, 1))) {
|
||||||
EPRINTF("malloc failed");
|
EPRINTF("malloc failed");
|
||||||
free(index);
|
free(index);
|
||||||
|
|
Loading…
Reference in a new issue