From 51b61ccdbf75f1a45485a2ba7a2216ffc970a744 Mon Sep 17 00:00:00 2001 From: Dmitry Kashitsyn Date: Sun, 15 Oct 2017 11:57:09 +0700 Subject: [PATCH] Extracts MemoryLruCache to a separate crate (#6693) --- util/memory_cache/Cargo.toml | 10 ++++++++++ util/{src/cache.rs => memory_cache/src/lib.rs} | 3 +++ util/src/lib.rs | 1 - 3 files changed, 13 insertions(+), 1 deletion(-) create mode 100644 util/memory_cache/Cargo.toml rename util/{src/cache.rs => memory_cache/src/lib.rs} (98%) diff --git a/util/memory_cache/Cargo.toml b/util/memory_cache/Cargo.toml new file mode 100644 index 000000000..9179b3c8a --- /dev/null +++ b/util/memory_cache/Cargo.toml @@ -0,0 +1,10 @@ +[package] +name = "memory_cache" +version = "0.1.0" +authors = ["Parity Technologies "] +description = "An LRU-cache which operates on memory used" +license = "GPL3" + +[dependencies] +heapsize = "0.4" +lru-cache = "0.1" diff --git a/util/src/cache.rs b/util/memory_cache/src/lib.rs similarity index 98% rename from util/src/cache.rs rename to util/memory_cache/src/lib.rs index e6f204192..af70b0cff 100644 --- a/util/src/cache.rs +++ b/util/memory_cache/src/lib.rs @@ -18,6 +18,9 @@ //! crate. // TODO: push changes upstream in a clean way. +extern crate heapsize; +extern crate lru_cache; + use heapsize::HeapSizeOf; use lru_cache::LruCache; diff --git a/util/src/lib.rs b/util/src/lib.rs index 863f811c4..7de3c4b39 100644 --- a/util/src/lib.rs +++ b/util/src/lib.rs @@ -116,7 +116,6 @@ extern crate log as rlog; pub mod misc; pub mod overlaydb; pub mod journaldb; -pub mod cache; pub use misc::*; pub use hashdb::*;