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

refactor: simplify pointer trait and remove DefaultPointerOps #100

Merged
merged 11 commits into from
Aug 3, 2023

Conversation

wenym1
Copy link
Collaborator

@wenym1 wenym1 commented Aug 2, 2023

What's changed and what's your intention?

As titled.

Checklist

  • I have written necessary rustdoc comments
  • I have added necessary unit tests and integration tests
  • I have passed make check and make test in my local envirorment.

Related issues or PRs (optional)

@codecov
Copy link

codecov bot commented Aug 2, 2023

Codecov Report

Merging #100 (ea6d09e) into main (0e5a595) will decrease coverage by 0.32%.
The diff coverage is 79.14%.

@@            Coverage Diff             @@
##             main     #100      +/-   ##
==========================================
- Coverage   67.60%   67.29%   -0.32%     
==========================================
  Files          41       41              
  Lines        5091     5014      -77     
==========================================
- Hits         3442     3374      -68     
+ Misses       1649     1640       -9     
Files Changed Coverage Δ
foyer-intrusive/src/eviction/mod.rs 64.70% <66.66%> (ø)
foyer-intrusive/src/core/pointer.rs 85.81% <70.11%> (-0.34%) ⬇️
foyer-intrusive/src/eviction/lfu.rs 88.32% <71.42%> (+0.67%) ⬆️
foyer-intrusive/src/eviction/lru.rs 65.85% <71.42%> (+0.37%) ⬆️
foyer-intrusive/src/collections/hashmap.rs 71.12% <81.81%> (-1.16%) ⬇️
foyer-intrusive/src/collections/dlist.rs 85.55% <90.00%> (-0.40%) ⬇️
...er-intrusive/src/collections/duplicated_hashmap.rs 94.18% <100.00%> (ø)
foyer-intrusive/src/core/adapter.rs 97.67% <100.00%> (-0.20%) ⬇️
foyer-intrusive/src/eviction/fifo.rs 93.75% <100.00%> (-0.25%) ⬇️
foyer-intrusive/src/eviction/sfifo.rs 95.72% <100.00%> (-0.14%) ⬇️

Copy link
Owner

@MrCroxx MrCroxx left a comment

Choose a reason for hiding this comment

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

General LGTM.

use std::fmt::Debug;

pub trait Config = Send + Sync + 'static + Debug + Clone;

pub trait EvictionPolicy: Send + Sync + 'static {
type Adapter: Adapter;
Copy link
Owner

Choose a reason for hiding this comment

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

It feels a little not unified here compared with other intrusive collections. Can we still use Adapter here?

@wenym1 wenym1 requested a review from MrCroxx August 3, 2023 06:05
Copy link
Owner

@MrCroxx MrCroxx left a comment

Choose a reason for hiding this comment

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

LGTM! Thanks for the great work!

@MrCroxx MrCroxx merged commit 049f538 into MrCroxx:main Aug 3, 2023
7 of 8 checks passed
@MrCroxx MrCroxx added the feature New feature or request label Aug 3, 2023
MrCroxx pushed a commit that referenced this pull request Apr 17, 2024
* refactor: simplify some generic type definition

* refactor: simplify pointer trait and remove DefaultPointerOps

* run clippy

* fix test compile

* rename PointerOps to Pointer

* use adapter in eviction policy associated type
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants