1
1
mirror of https://github.com/mawww/kakoune.git synced 2024-11-27 02:23:26 +03:00

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,16 +190,17 @@ private:
using UndoGroup = std::vector<Modification>;
friend class UndoGroupOptimizer;
std::vector<UndoGroup> m_history;
std::vector<UndoGroup>::iterator m_history_cursor;
UndoGroup m_current_undo_group;
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);
void revert_modification(const Modification& modification);
size_t m_last_save_undo_index;
std::vector<Change> m_changes;
Vector<Change, MemoryDomain::BufferMeta> m_changes;
time_t m_fs_timestamp;