瀏覽代碼

Merge pull request #1588 from ap29600/master

Fix leak in `core:container/bit_array`
gingerBill 3 年之前
父節點
當前提交
ad719e7c3a
共有 1 個文件被更改,包括 2 次插入1 次删除
  1. 2 1
      core/container/bit_array/bit_array.odin

+ 2 - 1
core/container/bit_array/bit_array.odin

@@ -1,6 +1,7 @@
 package dynamic_bit_array
 
 import "core:intrinsics"
+import "core:mem"
 
 /*
 	Note that these constants are dependent on the backing being a u64.
@@ -206,7 +207,7 @@ create :: proc(max_index: int, min_index := 0, allocator := context.allocator) -
 */
 clear :: proc(ba: ^Bit_Array) {
 	if ba == nil { return }
-	ba.bits = {}
+	mem.zero_slice(ba.bits[:])
 }
 
 /*