From 9adb97ea288e08bf9d098fc195aaf8c0f9a27c3e Mon Sep 17 00:00:00 2001 From: Maxime Coste Date: Sat, 10 Jan 2015 12:56:09 +0000 Subject: [PATCH] Track buffer lines memory --- src/buffer.hh | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/src/buffer.hh b/src/buffer.hh index 609a030d..a31062c4 100644 --- a/src/buffer.hh +++ b/src/buffer.hh @@ -167,15 +167,16 @@ private: void on_option_changed(const Option& option) override; - struct LineList : std::vector + using LineListBase = Vector; + struct LineList : LineListBase { [[gnu::always_inline]] InternedString& operator[](LineCount line) - { return std::vector::operator[]((int)line); } + { return LineListBase::operator[]((int)line); } [[gnu::always_inline]] const InternedString& operator[](LineCount line) const - { return std::vector::operator[]((int)line); } + { return LineListBase::operator[]((int)line); } }; LineList m_lines; @@ -189,16 +190,17 @@ private: using UndoGroup = std::vector; friend class UndoGroupOptimizer; - std::vector m_history; - std::vector::iterator m_history_cursor; - UndoGroup m_current_undo_group; + using History = Vector; + History m_history; + History::iterator m_history_cursor; + UndoGroup m_current_undo_group; void apply_modification(const Modification& modification); void revert_modification(const Modification& modification); size_t m_last_save_undo_index; - std::vector m_changes; + Vector m_changes; time_t m_fs_timestamp;