diff options
| author | Jeroen van Rijn <Kelimion@users.noreply.github.com> | 2022-03-06 12:29:17 +0100 |
|---|---|---|
| committer | Jeroen van Rijn <Kelimion@users.noreply.github.com> | 2022-03-06 12:29:17 +0100 |
| commit | ce057ff755d2fe852cb83e4025686d9efd3053d7 (patch) | |
| tree | fdec119d9833660a6c06c26de049fc833ff41ed3 /core/container/bit_array/doc.odin | |
| parent | ad719e7c3a258c84079581c7a9be71e0434c98cd (diff) | |
[bit_array] Really fix the leak.
Diffstat (limited to 'core/container/bit_array/doc.odin')
| -rw-r--r-- | core/container/bit_array/doc.odin | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/core/container/bit_array/doc.odin b/core/container/bit_array/doc.odin index 91e1362dd..52e252d8a 100644 --- a/core/container/bit_array/doc.odin +++ b/core/container/bit_array/doc.odin @@ -21,6 +21,7 @@ package dynamic_bit_array // returns `false`, `false`, because this Bit Array wasn't created to allow negative indices. was_set, was_retrieved := get(&bits, -1) fmt.println(was_set, was_retrieved) + destroy(&bits) } -- A Bit Array can optionally allow for negative indices, if the mininum value was given during creation: @@ -40,13 +41,13 @@ package dynamic_bit_array using bit_array bits := create(int(max(Foo)), int(min(Foo))) - defer destroy(&bits) + defer destroy(bits) - fmt.printf("Set(Bar): %v\n", set(&bits, Foo.Bar)) - fmt.printf("Get(Bar): %v, %v\n", get(&bits, Foo.Bar)) - fmt.printf("Set(Negative_Test): %v\n", set(&bits, Foo.Negative_Test)) - fmt.printf("Get(Leaves): %v, %v\n", get(&bits, Foo.Leaves)) - fmt.printf("Get(Negative_Test): %v, %v\n", get(&bits, Foo.Negative_Test)) + fmt.printf("Set(Bar): %v\n", set(bits, Foo.Bar)) + fmt.printf("Get(Bar): %v, %v\n", get(bits, Foo.Bar)) + fmt.printf("Set(Negative_Test): %v\n", set(bits, Foo.Negative_Test)) + fmt.printf("Get(Leaves): %v, %v\n", get(bits, Foo.Leaves)) + fmt.printf("Get(Negative_Test): %v, %v\n", get(bits, Foo.Negative_Test)) fmt.printf("Freed.\n") } */
\ No newline at end of file |