Skip to content
This repository has been archived by the owner on Nov 6, 2020. It is now read-only.

Fix for option 1 of JournalDB #658

Merged
merged 7 commits into from Mar 12, 2016
Merged

Fix for option 1 of JournalDB #658

merged 7 commits into from Mar 12, 2016

Conversation

gavofyork
Copy link
Contributor

No description provided.

@gavofyork gavofyork added the A0-pleasereview 🤓 Pull request needs code review. label Mar 10, 2016
@@ -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,
Copy link
Collaborator

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)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

old debug code. removing.

@arkpar
Copy link
Collaborator

arkpar commented Mar 10, 2016

DB version bump needed

@@ -24,6 +24,34 @@ use kvdb::{Database, DBTransaction, DatabaseConfig};
#[cfg(test)]
use std::env;

#[derive(Clone, PartialEq, Eq)]
struct RefInfo {
Copy link
Collaborator

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

@arkpar arkpar added A5-grumble 🔥 Pull request has minor issues that must be addressed before merging. and removed A0-pleasereview 🤓 Pull request needs code review. labels Mar 10, 2016
@gavofyork gavofyork added A0-pleasereview 🤓 Pull request needs code review. A1-onice 🌨 Pull request is reviewed well, but should not yet be merged. A3-inprogress ⏳ Pull request is in progress. No review needed at this stage. and removed A5-grumble 🔥 Pull request has minor issues that must be addressed before merging. A0-pleasereview 🤓 Pull request needs code review. A1-onice 🌨 Pull request is reviewed well, but should not yet be merged. labels Mar 10, 2016
@gavofyork
Copy link
Contributor Author

in progress until this has proper tests.

@gavofyork gavofyork added A0-pleasereview 🤓 Pull request needs code review. and removed A3-inprogress ⏳ Pull request is in progress. No review needed at this stage. labels Mar 12, 2016
@arkpar arkpar added A8-looksgood 🦄 Pull request is reviewed well. and removed A0-pleasereview 🤓 Pull request needs code review. labels Mar 12, 2016
arkpar added a commit that referenced this pull request Mar 12, 2016
Fix for option 1 of JournalDB
@arkpar arkpar merged commit bf84aee into master Mar 12, 2016
@arkpar arkpar deleted the fixjdb branch March 12, 2016 14:37
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
A8-looksgood 🦄 Pull request is reviewed well.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants