-
Notifications
You must be signed in to change notification settings - Fork 359
Open
Labels
enhancementNew feature or requestNew feature or request
Description
Deque is often used as a buffer. However, you can't always control how much data you accept. In these cases it usually makes sense to reclaim storage space if the capacity grows beyond some limit to avoid holding on to too much memory unnecessarily.
This isn't possible with Deque because its capacity is as an implementation detail.
In this thread @lorentey suggested letting Deque shrink on removal along and adding init(minimumCapacity:persistent:). I think this would be sufficient although as described it has a minor drawback that it wouldn't lazily grow up to a capacity limit.
- I assume adding
capacityis a non-starter based on Deque.md? - Has any more thought gone into allowing
Dequeto shrink automatically on removal?
lin72h
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request