diff options
author | Neil <nyamatongwe@gmail.com> | 2021-05-07 23:25:56 +1000 |
---|---|---|
committer | Neil <nyamatongwe@gmail.com> | 2021-05-07 23:25:56 +1000 |
commit | 8827755d994e9ebb49097da51a4e460c56385774 (patch) | |
tree | d930b836de6b4fe60be2f061cee2d491db58d00c /src/PositionCache.h | |
parent | 7d47304ca36474000293f267dda39483113c86e3 (diff) | |
download | scintilla-mirror-8827755d994e9ebb49097da51a4e460c56385774.tar.gz |
Use shared_ptr for LineLayoutCache as it simpifies lifetime management.
AutoLineLayout and other code no longer needed so removed.
Diffstat (limited to 'src/PositionCache.h')
-rw-r--r-- | src/PositionCache.h | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/src/PositionCache.h b/src/PositionCache.h index 41da53bcf..4c62900e8 100644 --- a/src/PositionCache.h +++ b/src/PositionCache.h @@ -61,7 +61,6 @@ private: int lenLineStarts; /// Drawing is only performed for @a maxLineLength characters on each line. Sci::Line lineNumber; - bool inCache; public: enum { wrapWidthInfinite = 0x7ffffff }; @@ -160,10 +159,9 @@ public: }; private: Cache level; - std::vector<std::unique_ptr<LineLayout>>cache; + std::vector<std::shared_ptr<LineLayout>>cache; bool allInvalidated; int styleClock; - int useCount; size_t EntryForLine(Sci::Line line) const noexcept; void AllocateForLevel(Sci::Line linesOnScreen, Sci::Line linesInDoc); public: @@ -178,9 +176,8 @@ public: void Invalidate(LineLayout::ValidLevel validity_) noexcept; void SetLevel(Cache level_) noexcept; Cache GetLevel() const noexcept { return level; } - LineLayout *Retrieve(Sci::Line lineNumber, Sci::Line lineCaret, int maxChars, int styleClock_, + std::shared_ptr<LineLayout> Retrieve(Sci::Line lineNumber, Sci::Line lineCaret, int maxChars, int styleClock_, Sci::Line linesOnScreen, Sci::Line linesInDoc); - void Dispose(LineLayout *ll) noexcept; }; class PositionCacheEntry { |