Skip to content

Commit

Permalink
Add allocator param.
Browse files Browse the repository at this point in the history
  • Loading branch information
Kelimion committed May 9, 2024
1 parent e5af98e commit 8f706a1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions core/slice/slice.odin
Original file line number Diff line number Diff line change
Expand Up @@ -730,9 +730,9 @@ bitset_to_enum_slice_with_buffer :: proc(buf: []$E, bs: $T) -> (slice: []E) wher
// e.g.:
// sl := slice.bitset_to_enum_slice(bs)
@(require_results)
bitset_to_enum_slice_with_make :: proc(bs: $T, $E: typeid) -> (slice: []E) where intrinsics.type_is_enum(E), intrinsics.type_bit_set_elem_type(T) == E {
bitset_to_enum_slice_with_make :: proc(bs: $T, $E: typeid, allocator := context.allocator) -> (slice: []E) where intrinsics.type_is_enum(E), intrinsics.type_bit_set_elem_type(T) == E {
ones := intrinsics.count_ones(transmute(E)bs)
buf := make([]E, int(ones))
buf := make([]E, int(ones), allocator)
return bitset_to_enum_slice(buf, bs)
}

Expand Down

0 comments on commit 8f706a1

Please sign in to comment.