-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Closed
Labels
proposalThis issue suggests modifications. If it also has the "accepted" label then it is planned.This issue suggests modifications. If it also has the "accepted" label then it is planned.standard libraryThis issue involves writing Zig code for the standard library.This issue involves writing Zig code for the standard library.
Milestone
Description
Several Zig data structures in the standard library have "unmanaged" types that require the user to pass an allocator to any function that may allocate. Examples include ArrayListUnmanaged and HashMapUnmanaged. There is however no such type for PriorityQueue.
I'm currently in need of a PriorityQueueUnmanaged, and I made one myself from the existing PriorityQueue code. I'd be happy to contribute it to the standard library if the contribution would be welcome.
The main questions I'd have for an acceptable implementation would be:
- Whether the original PriorityQueue type should be implemented in terms of the new PriorityQueueUnmanaged type. ArrayList seems to have separate implementations rather than having the managed version rely on the unmanaged version and I'm not sure why without reading it more closely. My inclination would be to implement PriorityQueue in terms of PriorityQueueUnmanaged but I'm curious whether others see drawbacks to this approach that I'm not seeing.
- Whether there should only be a PriorityQueueUnmanaged type, or whether the base type should be PriorityQueueAlignedUnmanaged similar to ArrayList. I have not done it with AlignedUnmanaged locally but given the backing data is just stored in a slice, I think an AlignedUnmanaged type would make sense.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
proposalThis issue suggests modifications. If it also has the "accepted" label then it is planned.This issue suggests modifications. If it also has the "accepted" label then it is planned.standard libraryThis issue involves writing Zig code for the standard library.This issue involves writing Zig code for the standard library.