Introduce >2GB compatible PR 1424 from fdkekin0

This commit is contained in:
jpirnay
2026-03-31 22:06:21 +02:00
parent 3f6d31b966
commit fd8fcbfd50
9 changed files with 801 additions and 389 deletions
+12 -2
View File
@@ -13,11 +13,14 @@
bool Xtc::load() {
LOG_DBG("XTC", "Loading XTC: %s", filepath.c_str());
// Ensure the per-book cache exists before the parser tries to create page_table.bin.
setupCacheDir();
// Initialize parser
parser.reset(new xtc::XtcParser());
// Open XTC file
xtc::XtcError err = parser->open(filepath.c_str());
// Open XTC file and initialize its cache-backed page table
xtc::XtcError err = parser->open(filepath.c_str(), cachePath.c_str());
if (err != xtc::XtcError::OK) {
LOG_ERR("XTC", "Failed to load: %s", xtc::errorToString(err));
parser.reset();
@@ -619,3 +622,10 @@ xtc::XtcError Xtc::getLastError() const {
}
return parser->getLastError();
}
void Xtc::prefetchPages(uint32_t pageIndex) const {
if (!loaded || !parser) {
return;
}
parser->prefetchWindow(pageIndex);
}