Fix for option 1 of JournalDB #658
Conversation
@@ -42,7 +71,8 @@ impl Clone for JournalDB { | |||
JournalDB { | |||
overlay: MemoryDB::new(), | |||
backing: self.backing.clone(), | |||
counters: self.counters.clone(), | |||
refs: self.refs.clone(), | |||
last_era: 0, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why 0 here? Isn't it related to what's in DB?
(it's not read anyway)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
old debug code. removing.
DB version bump needed |
@@ -24,6 +24,34 @@ use kvdb::{Database, DBTransaction, DatabaseConfig}; | |||
#[cfg(test)] | |||
use std::env; | |||
|
|||
#[derive(Clone, PartialEq, Eq)] | |||
struct RefInfo { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Idea for future optimization: compact this struct. Too bad rust does not support bit fields. In my original implementation I've used u16
for counter and #[repr(packed)]
for the structure to reduce memory usage. It is also possible to use a single bit of queue_refs
for the flag
in progress until this has proper tests. |
No description provided.