some fixes

This commit is contained in:
silverweed 2024-07-16 11:45:32 +02:00
parent b8a23aa37a
commit e13f4d5e4f
2 changed files with 9 additions and 3 deletions

View file

@ -60,14 +60,15 @@ u32 mem_edit_bg_color_fn(const u8 *, u64 off, void *user_data)
} }
if (rdata.rng_anchor_key.start <= off && off < rdata.rng_anchor_key.end()) return COL(app->vsettings.col_key); if (rdata.rng_anchor_key.start <= off && off < rdata.rng_anchor_key.end()) return COL(app->vsettings.col_key);
if (rdata.rng_header.start - rblob_sz <= off && off <= rdata.rng_header.start) return COL(app->vsettings.col_key); if (rdata.rng_header.start - rblob_sz <= off && off < rdata.rng_header.start) return COL(app->vsettings.col_key);
if (rdata.rng_footer.start - rblob_sz <= off && off <= rdata.rng_footer.start) return COL(app->vsettings.col_key); if (rdata.rng_footer.start - rblob_sz <= off && off < rdata.rng_footer.start) return COL(app->vsettings.col_key);
if (rdata.rng_anchor.start <= off && off < rdata.rng_anchor.end()) return COL(app->vsettings.col_anchor); if (rdata.rng_anchor.start <= off && off < rdata.rng_anchor.end()) return COL(app->vsettings.col_anchor);
if (rdata.rng_header.start <= off && off < rdata.rng_header.end()) return COL(app->vsettings.col_header); if (rdata.rng_header.start <= off && off < rdata.rng_header.end()) return COL(app->vsettings.col_header);
if (rdata.rng_footer.start <= off && off < rdata.rng_footer.end()) return COL(app->vsettings.col_footer); if (rdata.rng_footer.start <= off && off < rdata.rng_footer.end()) return COL(app->vsettings.col_footer);
// Slow page group lookup, ideally only done once per render when last_pinfo is invalid. // Slow page group lookup, ideally only done once per render when last_pinfo is invalid.
for (Page_Info_Chunk *chunk = rdata.page_chunks; chunk; chunk = chunk->next) { for (Page_Info_Chunk *chunk = rdata.page_chunks; chunk; chunk = chunk->next) {
if (chunk->range.start - rblob_sz <= off && off < chunk->range.start) return COL(app->vsettings.col_key);
if (chunk->range.start <= off && off < chunk->range.end()) { if (chunk->range.start <= off && off < chunk->range.end()) {
for (u64 group_idx = chunk->first_group; group_idx < rdata.n_page_groups; ++group_idx) { for (u64 group_idx = chunk->first_group; group_idx < rdata.n_page_groups; ++group_idx) {
const Page_Info_Group &group = rdata.page_groups[group_idx]; const Page_Info_Group &group = rdata.page_groups[group_idx];

View file

@ -1177,7 +1177,12 @@ RMicroFileReader::GetNTupleProper(const char *ntupleName)
fileInfo.anchor_key_nbytes = key.fKeyLen; fileInfo.anchor_key_nbytes = key.fKeyLen;
fileInfo.anchor_seek = offset; fileInfo.anchor_seek = offset;
fileInfo.anchor_nbytes = objNbytes; fileInfo.anchor_nbytes = objNbytes;
fileInfo.rblob_key_header_nbytes = RTFKey{}.GetHeaderSize() + 3; {
// @Incomplete: each section has a differently-sized RBlob, we need to account for that!
RTFKey dummy;
dummy.MakeBigKey();
fileInfo.rblob_key_header_nbytes = dummy.GetHeaderSize();
}
fileInfo.tfile_header_nbytes = RTFHeader{}.GetSize(); fileInfo.tfile_header_nbytes = RTFHeader{}.GetSize();
// @---- // @----
ReadBuffer(ntuple, objNbytes, offset); ReadBuffer(ntuple, objNbytes, offset);