From cff99f5431fc47ff873658f05d4696b5226ffdd1 Mon Sep 17 00:00:00 2001 From: Ryan Fleury Date: Mon, 2 Jun 2025 14:00:47 -0700 Subject: [PATCH] oops, fix very bad mistake, using part of HS roots that don't exist! --- build.bat | 2 +- src/base/base_core.h | 2 +- src/hash_store/hash_store.c | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/build.bat b/build.bat index d088335e..b1fbb145 100644 --- a/build.bat +++ b/build.bat @@ -46,7 +46,7 @@ if "%opengl%"=="1" set auto_compile_flags=%auto_compile_flags% -DR_BACKEND=R_ :: --- Compile/Link Line Definitions ------------------------------------------ set cl_common= /I..\src\ /I..\local\ /nologo /FC /Z7 -set clang_common= -I..\src\ -I..\local\ -gcodeview -fdiagnostics-absolute-paths -Wall -Wno-unknown-warning-option -Wno-missing-braces -Wno-unused-function -Wno-writable-strings -Wno-unused-value -Wno-unused-variable -Wno-unused-local-typedef -Wno-deprecated-register -Wno-deprecated-declarations -Wno-unused-but-set-variable -Wno-single-bit-bitfield-constant-conversion -Wno-compare-distinct-pointer-types -Wno-initializer-overrides -Wno-incompatible-pointer-types-discards-qualifiers -Xclang -flto-visibility-public-std -D_USE_MATH_DEFINES -Dstrdup=_strdup -Dgnu_printf=printf -ferror-limit=10000 +set clang_common= -I..\src\ -I..\local\ -gcodeview -fdiagnostics-absolute-paths -Wall -Wno-unknown-warning-option -Wno-missing-braces -Wno-unused-function -Wno-unused-parameter -Wno-writable-strings -Wno-missing-field-initializers -Wno-unused-value -Wno-unused-variable -Wno-unused-local-typedef -Wno-deprecated-register -Wno-deprecated-declarations -Wno-unused-but-set-variable -Wno-single-bit-bitfield-constant-conversion -Wno-compare-distinct-pointer-types -Wno-initializer-overrides -Wno-incompatible-pointer-types-discards-qualifiers -Xclang -flto-visibility-public-std -D_USE_MATH_DEFINES -Dstrdup=_strdup -Dgnu_printf=printf -ferror-limit=10000 set cl_debug= call cl /Od /Ob1 /DBUILD_DEBUG=1 %cl_common% %auto_compile_flags% set cl_release= call cl /O2 /DBUILD_DEBUG=0 %cl_common% %auto_compile_flags% set clang_debug= call clang -g -O0 -DBUILD_DEBUG=1 %clang_common% %auto_compile_flags% diff --git a/src/base/base_core.h b/src/base/base_core.h index ab7b35f3..01e3423f 100644 --- a/src/base/base_core.h +++ b/src/base/base_core.h @@ -346,7 +346,7 @@ C_LINKAGE void __asan_unpoison_memory_region(void const volatile *addr, size_t s #else # error Missing pointer-to-integer cast for this architecture. #endif -#define PtrFromInt(i) (void*)((U8*)0 + (i)) +#define PtrFromInt(i) (void*)(i) #define Compose64Bit(a,b) ((((U64)a) << 32) | ((U64)b)); #define AlignPow2(x,b) (((x) + (b) - 1)&(~((b) - 1))) diff --git a/src/hash_store/hash_store.c b/src/hash_store/hash_store.c index f7b819e9..b5a6f574 100644 --- a/src/hash_store/hash_store.c +++ b/src/hash_store/hash_store.c @@ -114,7 +114,7 @@ hs_root_alloc(void) { HS_Root root = {0}; root.u64[0] = ins_atomic_u64_inc_eval(&hs_shared->root_id_gen); - U64 slot_idx = root.u64[1]%hs_shared->root_slots_count; + U64 slot_idx = root.u64[0]%hs_shared->root_slots_count; U64 stripe_idx = slot_idx%hs_shared->root_stripes_count; HS_RootSlot *slot = &hs_shared->root_slots[slot_idx]; HS_Stripe *stripe = &hs_shared->root_stripes[stripe_idx]; @@ -140,7 +140,7 @@ internal void hs_root_release(HS_Root root) { //- rjf: unpack root - U64 slot_idx = root.u64[1]%hs_shared->root_slots_count; + U64 slot_idx = root.u64[0]%hs_shared->root_slots_count; U64 stripe_idx = slot_idx%hs_shared->root_stripes_count; HS_RootSlot *slot = &hs_shared->root_slots[slot_idx]; HS_Stripe *stripe = &hs_shared->root_stripes[stripe_idx];