Reduce memory footprint

This commit is contained in:
jpirnay
2026-05-11 21:50:44 +02:00
parent 5b3f1ad200
commit fb16db2b48
7 changed files with 373 additions and 32 deletions
+2
View File
@@ -17,6 +17,7 @@ class Section {
std::string filePath;
FsFile file;
std::vector<uint32_t> lut; // Cached page byte-offsets; loaded once, avoids per-page LUT seek
bool truncatedCache = false;
void writeSectionFileHeader(int fontId, float lineCompression, bool extraParagraphSpacing, uint8_t paragraphAlignment,
uint16_t viewportWidth, uint16_t viewportHeight, bool hyphenationEnabled,
@@ -68,6 +69,7 @@ class Section {
bool bionicReadingEnabled, uint8_t imageRendering,
const std::function<void(int)>& progressFn = nullptr);
std::unique_ptr<Page> loadPageFromSectionFile();
bool isTruncatedCache() const { return truncatedCache; }
// Given a page in this section, return the TOC index for that page.
int getTocIndexForPage(int page) const;