Open saltzm opened 2 months ago
Since this is a lesser used API, I think it's OK to be a little more experimental and aggressive with breakage. My suggestion is to modify the existing one to become unmanaged, and drop the "unmanaged" from the name, same as how is currently done for MultiArrayList
.
I agree with Andrew.
Should PriorityDequeue
also undergo the same change?
Sure
2. 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.
Let's start with only having the default-aligned version. I think we can get away with that, and it's nicer to avoid it if possible.
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: