Fix free bug not using the correct allocator

This commit is contained in:
gingerBill
2024-03-27 12:54:52 +00:00
parent 6422c090f2
commit b378eb2df3
2 changed files with 10 additions and 10 deletions
+1 -1
View File
@@ -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
}
+9 -9
View File
@@ -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 {