Skip to content

Commit

Permalink
rust: update intrusive-collections to 0.9.2
Browse files Browse the repository at this point in the history
  • Loading branch information
ptrus committed Aug 4, 2021
1 parent deefce7 commit 156923a
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 27 deletions.
1 change: 1 addition & 0 deletions .changelog/4174.internal.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
rust: bump intrusive-collections to 0.9.2
10 changes: 0 additions & 10 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,13 +43,3 @@ updates:
labels:
- c:deps
- rust
ignore:
# We are using a ring-sgx patch, so ring is manually updated.
# https://github.com/oasislabs/ring-sgx
- dependency-name: ring
# Webpki update forces ring update.
- dependency-name: webpki
# Wait with update until https://github.com/Amanieu/intrusive-rs/pull/51
# is merged and released, so we can continue using `intrusive_adapter!`
# macro in`lru_cache.rs`.
- dependency-name: intrusive-collections
4 changes: 2 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion runtime/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ deoxysii = "0.2.2"
tiny-keccak = { version = "2.0.2", features = ["sha3"] }
sp800-185 = "0.2.0"
zeroize = "1.4"
intrusive-collections = "0.8"
intrusive-collections = "0.9.2"
sha2 = "0.9.5"
hmac = "0.11.0"
honggfuzz = "0.5.54"
Expand Down
15 changes: 1 addition & 14 deletions runtime/src/storage/mkvs/cache/lru_cache.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use std::{any::Any, cell::RefCell, pin::Pin, ptr::NonNull, rc::Rc, sync::Arc};

use anyhow::{anyhow, Result};
use intrusive_collections::{intrusive_adapter, IntrusivePointer, LinkedList, LinkedListLink};
use intrusive_collections::{intrusive_adapter, LinkedList, LinkedListLink};
use io_context::Context;
use thiserror::Error;

Expand All @@ -17,19 +17,6 @@ pub struct CacheItemBox<Item: CacheItem + Default> {
link: LinkedListLink,
}

unsafe impl<T: CacheItem + Default> IntrusivePointer<CacheItemBox<T>>
for Pin<Box<CacheItemBox<T>>>
{
#[inline]
fn into_raw(self) -> *const CacheItemBox<T> {
unsafe { Box::into_raw(Pin::into_inner_unchecked(self)) }
}
#[inline]
unsafe fn from_raw(ptr: *const CacheItemBox<T>) -> Self {
Box::into_pin(Box::from_raw(ptr as *mut CacheItemBox<T>))
}
}

intrusive_adapter!(
CacheItemAdapter<Item> = Pin<Box<CacheItemBox<Item>>>:
CacheItemBox<Item> { link: LinkedListLink }
Expand Down

0 comments on commit 156923a

Please sign in to comment.