Issue #10: Remove too old pages from cache

This commit is contained in:
Jakub Melka
2022-02-05 18:18:21 +01:00
parent 49cab7937a
commit 8bf2913ded
5 changed files with 106 additions and 1 deletions

View File

@ -106,6 +106,13 @@ public:
/// \param compile Compile the page, if it is not found in the cache
const PDFPrecompiledPage* getCompiledPage(PDFInteger pageIndex, bool compile);
/// Performs smart cache clear. Too old pages are removed from the cache,
/// but only if these pages are not in active pages. Use this function to
/// clear cache to avoid huge memory consumption.
/// \param milisecondsLimit Pages with access time above this limit will be erased
/// \param activePages Sorted vector of active pages, which should remain in cache
void smartClearCache(const int milisecondsLimit, const std::vector<PDFInteger>& activePages);
/// Is operation being cancelled?
virtual bool isOperationCancelled() const override;