Merge pull request #9426 from ThomasWaldmann/hashindex_size-64bit
Some checks failed
CI / lint (push) Has been cancelled
CodeQL / Analyze (push) Has been cancelled
Windows CI / msys2-ucrt64 (push) Has been cancelled
CI / asan_ubsan (push) Has been cancelled
CI / native_tests (push) Has been cancelled
CI / vm_tests (Haiku, false, haiku, r1beta5) (push) Has been cancelled
CI / vm_tests (NetBSD, false, netbsd, 10.1) (push) Has been cancelled
CI / vm_tests (OpenBSD, false, openbsd, 7.7) (push) Has been cancelled
CI / vm_tests (borg-freebsd-14-x86_64-gh, FreeBSD, true, freebsd, 14.3) (push) Has been cancelled

hashindex_size: return int64_t, fixes #9423
This commit is contained in:
TW 2026-03-01 19:17:03 +01:00 committed by GitHub
commit 0a0eed485b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 4 additions and 4 deletions

View file

@ -718,10 +718,10 @@ hashindex_len(HashIndex *index)
return index->num_entries;
}
static int
static int64_t
hashindex_size(HashIndex *index)
{
return sizeof(HashHeader) + index->num_buckets * index->bucket_size;
return sizeof(HashHeader) + (int64_t)index->num_buckets * index->bucket_size;
}
/*

View file

@ -4,7 +4,7 @@ import locale
import os
cimport cython
from libc.stdint cimport uint32_t, UINT32_MAX, uint64_t
from libc.stdint cimport int64_t, uint32_t, UINT32_MAX, uint64_t
from libc.errno cimport errno
from libc.string cimport memcpy
from cpython.exc cimport PyErr_SetFromErrnoWithFilename
@ -26,7 +26,7 @@ cdef extern from "_hashindex.c":
HashIndex *hashindex_init(int capacity, int key_size, int value_size)
void hashindex_free(HashIndex *index)
int hashindex_len(HashIndex *index)
int hashindex_size(HashIndex *index)
int64_t hashindex_size(HashIndex *index)
void hashindex_write(HashIndex *index, object file_py) except *
unsigned char *hashindex_get(HashIndex *index, unsigned char *key)
unsigned char *hashindex_next_key(HashIndex *index, unsigned char *key)