From b378eb2df39c9d73c383e430321e49d48c4fb17c Mon Sep 17 00:00:00 2001 From: gingerBill Date: Wed, 27 Mar 2024 12:54:52 +0000 Subject: [PATCH] Fix free bug not using the correct allocator --- core/hash/xxhash/streaming.odin | 2 +- core/hash/xxhash/xxhash_32.odin | 18 +++++++++--------- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/core/hash/xxhash/streaming.odin b/core/hash/xxhash/streaming.odin index 07744a12b..f68862f67 100644 --- a/core/hash/xxhash/streaming.odin +++ b/core/hash/xxhash/streaming.odin @@ -129,7 +129,7 @@ XXH3_create_state :: proc(allocator := context.allocator) -> (res: ^XXH3_state, } XXH3_destroy_state :: proc(state: ^XXH3_state, allocator := context.allocator) -> (err: Error) { - free(state) + free(state, allocator) return .None } diff --git a/core/hash/xxhash/xxhash_32.odin b/core/hash/xxhash/xxhash_32.odin index 2f27118f2..b0dea305e 100644 --- a/core/hash/xxhash/xxhash_32.odin +++ b/core/hash/xxhash/xxhash_32.odin @@ -19,15 +19,15 @@ xxh_u32 :: u32 XXH32_DEFAULT_SEED :: XXH32_hash(0) XXH32_state :: struct { - total_len_32: XXH32_hash, /*!< Total length hashed, modulo 2^32 */ - large_len: XXH32_hash, /*!< Whether the hash is >= 16 (handles @ref total_len_32 overflow) */ - v1: XXH32_hash, /*!< First accumulator lane */ - v2: XXH32_hash, /*!< Second accumulator lane */ - v3: XXH32_hash, /*!< Third accumulator lane */ - v4: XXH32_hash, /*!< Fourth accumulator lane */ - mem32: [4]XXH32_hash, /*!< Internal buffer for partial reads. Treated as unsigned char[16]. */ - memsize: XXH32_hash, /*!< Amount of data in @ref mem32 */ - reserved: XXH32_hash, /*!< Reserved field. Do not read or write to it, it may be removed. */ + total_len_32: XXH32_hash, /*!< Total length hashed, modulo 2^32 */ + large_len: XXH32_hash, /*!< Whether the hash is >= 16 (handles @ref total_len_32 overflow) */ + v1: XXH32_hash, /*!< First accumulator lane */ + v2: XXH32_hash, /*!< Second accumulator lane */ + v3: XXH32_hash, /*!< Third accumulator lane */ + v4: XXH32_hash, /*!< Fourth accumulator lane */ + mem32: [4]XXH32_hash, /*!< Internal buffer for partial reads. Treated as unsigned char[16]. */ + memsize: XXH32_hash, /*!< Amount of data in @ref mem32 */ + reserved: XXH32_hash, /*!< Reserved field. Do not read or write to it, it may be removed. */ } XXH32_canonical :: struct {