You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is it possible to forcibly insert a value at a given key? Either by allocating up to a given key, inserting into a vacant entry, or evicting a already occupied one. I'm in a situation where I need to keep multiple slabs and keep the same key between all of them. Would the bookkeeping make this prohibitively expensive?
The text was updated successfully, but these errors were encountered:
The cost of that would be linear time. The slab stores the list of unused indexes by threading a linked list through the slab. Removing something from that linked list requires traversing the entire linked list to find the position that comes before it.
An alternative solution to this pattern is to have one slab, used to determine the index and maintain a freelist, and maintain Vec<Option<T>>s on the side that share the same indexes.
Is it possible to forcibly insert a value at a given key? Either by allocating up to a given key, inserting into a vacant entry, or evicting a already occupied one. I'm in a situation where I need to keep multiple slabs and keep the same key between all of them. Would the bookkeeping make this prohibitively expensive?
The text was updated successfully, but these errors were encountered: