Track buffer lines memory

This commit is contained in:
Maxime Coste 2015-01-10 12:56:09 +00:00
parent 9f9156a752
commit 9adb97ea28

View File

@ -167,15 +167,16 @@ private:
void on_option_changed(const Option& option) override;
struct LineList : std::vector<InternedString>
using LineListBase = Vector<InternedString, MemoryDomain::BufferContent>;
struct LineList : LineListBase
{
[[gnu::always_inline]]
InternedString& operator[](LineCount line)
{ return std::vector<InternedString>::operator[]((int)line); }
{ return LineListBase::operator[]((int)line); }
[[gnu::always_inline]]
const InternedString& operator[](LineCount line) const
{ return std::vector<InternedString>::operator[]((int)line); }
{ return LineListBase::operator[]((int)line); }
};
LineList m_lines;
@ -189,8 +190,9 @@ private:
using UndoGroup = std::vector<Modification>;
friend class UndoGroupOptimizer;
std::vector<UndoGroup> m_history;
std::vector<UndoGroup>::iterator m_history_cursor;
using History = Vector<UndoGroup, MemoryDomain::BufferMeta>;
History m_history;
History::iterator m_history_cursor;
UndoGroup m_current_undo_group;
void apply_modification(const Modification& modification);
@ -198,7 +200,7 @@ private:
size_t m_last_save_undo_index;
std::vector<Change> m_changes;
Vector<Change, MemoryDomain::BufferMeta> m_changes;
time_t m_fs_timestamp;