refactor: Memory optimization and XTC format removal

Memory optimization:
- Add LOG_STACK_WATERMARK macro for task stack monitoring
- Add freeCoverBufferIfAllocated() and preloadCoverBuffer() for memory management
- Improve cover buffer reuse to reduce heap fragmentation
- Add grayscale buffer cleanup safety in GfxRenderer
- Make grayscale rendering conditional on successful buffer allocation
- Add detailed heap fragmentation logging with ESP-IDF API
- Add CSS parser memory usage estimation

XTC format removal:
- Remove entire lib/Xtc library (XTC parser and types)
- Remove XtcReaderActivity and XtcReaderChapterSelectionActivity
- Remove XTC file handling from HomeActivity, SleepActivity, ReaderActivity
- Remove .xtc/.xtch from supported extensions in BookManager
- Remove XTC cache prefix from Md5Utils
- Update web server and file browser to exclude XTC format
- Clear in-memory caches when disk cache is cleared
This commit is contained in:
cottongin
2026-01-27 20:35:32 -05:00
parent 158caacfe0
commit c2a966a6ea
30 changed files with 201 additions and 2624 deletions

View File

@@ -12,7 +12,7 @@ namespace {
constexpr const char* LOG_TAG = "BM";
// Supported book extensions
const char* SUPPORTED_EXTENSIONS[] = {".epub", ".txt", ".xtc", ".xtch"};
const char* SUPPORTED_EXTENSIONS[] = {".epub", ".txt"};
constexpr size_t SUPPORTED_EXTENSIONS_COUNT = sizeof(SUPPORTED_EXTENSIONS) / sizeof(SUPPORTED_EXTENSIONS[0]);
} // namespace
@@ -45,8 +45,6 @@ std::string BookManager::getCachePrefix(const std::string& path) {
return "epub_";
} else if (ext == ".txt") {
return "txt_";
} else if (ext == ".xtc" || ext == ".xtch") {
return "xtc_";
}
return "";
}