diff options
author | ridiculousfish <corydoras@ridiculousfish.com> | 2012-12-02 23:38:38 -0800 |
---|---|---|
committer | ridiculousfish <corydoras@ridiculousfish.com> | 2012-12-02 23:38:38 -0800 |
commit | 984a4980635c637057ada3efc9a213c0a1d037a9 (patch) | |
tree | d3843cf87733aa259be1aa9bb237e7c1a63eec03 /history.h | |
parent | c1b51c65302f2d2a8008d9d02c40b9bd594cc3e8 (diff) |
More work towards incremental history. Added some tests.
Diffstat (limited to 'history.h')
-rw-r--r-- | history.h | 15 |
1 files changed, 11 insertions, 4 deletions
@@ -8,6 +8,7 @@ #include <wchar.h> #include "common.h" #include "pthread.h" +#include "wutil.h" #include <vector> #include <utility> #include <list> @@ -120,9 +121,6 @@ private: /** Deleted item contents. */ std::set<wcstring> deleted_items; - /** How many items we've added without saving */ - size_t unsaved_item_count; - /** The mmaped region for the history file */ const char *mmap_start; @@ -131,6 +129,9 @@ private: /** The type of file we mmap'd */ history_file_type_t mmap_type; + + /** The file ID of the file we mmap'd */ + file_id_t mmap_file_id; /** Timestamp of when this history was created */ const time_t birth_timestamp; @@ -159,7 +160,10 @@ private: bool save_internal_via_appending(); /** Saves history */ - void save_internal(); + void save_internal(bool vacuum); + + /** Whether we're in maximum chaos mode, useful for testing */ + bool chaos_mode; /* Versioned decoding */ static history_item_t decode_item_fish_2_0(const char *base, size_t len); @@ -184,6 +188,9 @@ public: /** Saves history */ void save(); + + /** Performs a full (non-incremental) save */ + void save_and_vacuum(); /** Irreversibly clears history */ void clear(); |