lru get to return a copy rather than ref. Add more lru tests#177
Merged
Conversation
szmyd
approved these changes
Sep 11, 2023
szmyd
left a comment
Collaborator
There was a problem hiding this comment.
Explanation makes sense; 👍
szmyd
added a commit
that referenced
this pull request
Jan 10, 2024
* dump breakpad stacktrace file in the same dir as logfile (#151) Co-authored-by: Ravi Akella email = raakella@ebay.com <raakella@sdsbuild07> * Token Caching (#169) * add caching to auth_manager * fix the auth test after caching * update folly cmake * add build missing for all branch builds --------- Authored-by: Ravi Akella email = raakella@ebay.com <raakella@sdsbuild07> * add date to 3rd party (#170) Co-authored-by: Ravi Akella email = raakella@ebay.com <raakella@sdsbuild07> * include filesystem header in logging.h (#175) Co-authored-by: Ravi Akella email = raakella@ebay.com <raakella@sdsbuild07> * acquire unique lock for LRU cache get operation (#176) Co-authored-by: Ravi Akella email = raakella@ebay.com <raakella@sdsbuild07> * lru get to return a copy rather than ref. Add more lru tests (#177) Co-authored-by: Ravi Akella email = raakella@ebay.com <raakella@sdsbuild07> * disable stress test (#178) Co-authored-by: Ravi Akella email = raakella@ebay.com <raakella@sdsbuild07> * remove file from the map regardless of the inotify result during remove watch (#201) Co-authored-by: Ravi Nagarjun Akella <raakella1@$HOSTNAME> * remove -u option from conan create to fix build conflict in libcurl (#202) Co-authored-by: Ravi Nagarjun Akella <raakella1@$HOSTNAME> --------- Co-authored-by: raakella1 <114193113+raakella1@users.noreply.github.com> Co-authored-by: Ravi Akella email = raakella@ebay.com <raakella@sdsbuild07> Co-authored-by: Ravi Nagarjun Akella <raakella1@$HOSTNAME>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
It is not safe to return a reference of the cache entry to the caller of get in LRUCache, especially when we have a multi threaded env. We now return a copy. The caller can use T* or shared_ptr as value to optimize for object copy