Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add lru_cache to libextra #10211

Closed
wants to merge 1 commit into from
Closed

Conversation

ktt3ja
Copy link
Contributor

@ktt3ja ktt3ja commented Nov 1, 2013

There's an open issue (Issue #4988) for adding an LRU Cache to the standard library. I'm new to this so I hope I didn't miss anything I'm supposed to do.

}

impl<K: Hash + Eq + Clone, V> LruCache<K, V> {
fn new(max_size: uint) -> LruCache<K, V> {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pub fn new?

@ktt3ja
Copy link
Contributor Author

ktt3ja commented Nov 4, 2013

Is everything good or is there still something that needs fixing?

@jdm
Copy link
Contributor

jdm commented Nov 4, 2013

It needs a rebase.

@ktt3ja
Copy link
Contributor Author

ktt3ja commented Nov 4, 2013

What about now?

@alexcrichton
Copy link
Member

This is a pretty awesome data structure to have, and we've recently had some awesome data structures have pull requests opened. In general, we plan on dissolving libextra soon to a conglomerate of packages (exact details yet to be determined), and this probably belongs in there. In the meantime, we've been hesitant to add more data structures to libextra as a consequence because it's just another thing which we'd have to figure out where to go.

This is some nice work though! I think we'll want to discuss this a bit. I've added this to the agenda for the meeting tomorrow.

@brson
Copy link
Contributor

brson commented Dec 5, 2013

@alexcrichton Looks like we never got around to talking about this at a meeting? I'm thinking we should go ahead and add it since it looks nice and is self contained, and if it ends up living somewhere else then so be it. @ktt3ja the motivation for having an LRU cache is for use in servo, so you might ask the people in #servo where this can be applied, see if it fits their use case, then use it there.

@thestinger
Copy link
Contributor

+1 for adding this, FWIW - I think it should go in libstd though

(Python has OrderedDict and an lru_cache decorator based on it in the standard library)

bors added a commit that referenced this pull request Dec 5, 2013
There's an open issue ([Issue #4988](#4988)) for adding an LRU Cache to the standard library. I'm new to this so I hope I didn't miss anything I'm supposed to do.
@jdm
Copy link
Contributor

jdm commented Dec 5, 2013

We could replace our existing Servo LRU cache implementation: http://mxr.mozilla.org/servo/source/src/components/util/cache.rs#114

@bors bors closed this Dec 5, 2013
@ktt3ja ktt3ja deleted the add-lrucache branch December 6, 2013 01:42
@andrewrk
Copy link

Whatever happened to this LRU cache? Will it ever be resurrected in std::collections?

@ktt3ja
Copy link
Contributor Author

ktt3ja commented Feb 4, 2015

@andrewrk: It was removed in PR #19955

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants