Browse Source

Fix free bug not using the correct allocator

gingerBill 1 year ago
parent
commit
b378eb2df3
2 changed files with 10 additions and 10 deletions
  1. 1 1
      core/hash/xxhash/streaming.odin
  2. 9 9
      core/hash/xxhash/xxhash_32.odin

+ 1 - 1
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
 }
 

+ 9 - 9
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 {