aboutsummaryrefslogtreecommitdiff
path: root/core/container/queue/queue.odin
diff options
context:
space:
mode:
Diffstat (limited to 'core/container/queue/queue.odin')
-rw-r--r--core/container/queue/queue.odin9
1 files changed, 6 insertions, 3 deletions
diff --git a/core/container/queue/queue.odin b/core/container/queue/queue.odin
index 75b00d376..7e3e18075 100644
--- a/core/container/queue/queue.odin
+++ b/core/container/queue/queue.odin
@@ -23,10 +23,13 @@ DEFAULT_CAPACITY :: 16
Initialize a `Queue` with a starting `capacity` and an `allocator`.
*/
init :: proc(q: ^$Q/Queue($T), capacity := DEFAULT_CAPACITY, allocator := context.allocator) -> runtime.Allocator_Error {
- if q.data.allocator.procedure == nil {
- q.data.allocator = allocator
- }
clear(q)
+ q.data = transmute([dynamic]T)runtime.Raw_Dynamic_Array{
+ data = nil,
+ len = 0,
+ cap = 0,
+ allocator = allocator,
+ }
return reserve(q, capacity)
}