correctly decompress rdis in radbin dumping path; do not compress zero-sized sections in rdi make

This commit is contained in:
Ryan Fleury
2025-10-13 12:47:46 -07:00
parent 87edc583bf
commit ec39cefc9e
2 changed files with 8 additions and 6 deletions
+7
View File
@@ -1152,6 +1152,13 @@ rb_thread_entry_point(void *p)
{
RDI_Parsed rdi = {0};
RDI_ParseStatus rdi_status = rdi_parse(f->data.str, f->data.size, &rdi);
U64 decompressed_size = rdi_decompressed_size_from_parsed(&rdi);
if(decompressed_size > rdi.raw_data_size)
{
U8 *decompressed_data = push_array_no_zero(arena, U8, decompressed_size);
rdi_decompress_parsed(decompressed_data, decompressed_size, &rdi);
rdi_status = rdi_parse(decompressed_data, decompressed_size, &rdi);
}
switch(rdi_status)
{
default:{}break;
+1 -6
View File
@@ -2982,12 +2982,7 @@ rdim_compress(Arena *arena, RDIM_SerializedSectionBundle *in)
RDIM_SerializedSection *src = &in->sections[k];
RDIM_SerializedSection *dst = &out.sections[k];
MemoryCopyStruct(dst, src);
// rjf: determine if this section should be compressed
B32 should_compress = 1;
// rjf: compress if needed
if(should_compress)
if(src->encoded_size != 0)
{
MemoryZero(ctx.m_hashTable, sizeof(U16)*(1<<ctx.m_tableSizeBits));
dst->data = push_array_no_zero(arena, U8, src->encoded_size);