fix(pointer cache): cache version should be sensitive to field count (#1512)

This commit is contained in:
Quentin 2023-06-23 14:56:40 +02:00 committed by GitHub
parent 1eae251012
commit 717468087c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -22,7 +22,10 @@ namespace big
{
static_assert(batch_hash > 0);
cache_file.set_cache_version(batch_hash);
constexpr size_t field_count = (offset_of_cache_end_field - offset_of_cache_begin_field) / sizeof(void*);
constexpr auto cache_version = batch_hash + field_count;
cache_file.set_cache_version(cache_version);
const uintptr_t pointer_to_cacheable_data_start = reinterpret_cast<uintptr_t>(this) + offset_of_cache_begin_field;