Release Notes — CPR-vCodex-Steroids 1.3.0.35-dev5
A lot of improvements, with a few minor bugs still present. Library handling is significantly better. XTC covers are missing and will be fixed in the next release — hopefully all discovered bugs are now resolved. There is still a limit of 300–400 books.
🧠 Memory & Stability (Heap Optimization)
This release includes a major pass on heap management and fragmentation across the library, cover generation, and web server subsystems.
- Freed ~67 KB of static RAM by moving several large buffers from BSS to lazily-allocated heap (PNG decoder, upload buffers), reducing baseline memory usage when those features are idle.
- Fixed image/cover corruption ("X" placeholder) during EPUB reading and library indexing. The root cause was heap fragmentation triggered by the legacy XML (expat) parser and large single-block memory allocations during EPUB metadata/cover extraction. These were replaced with a lightweight, streaming ZIP/XML reader that decodes titles, authors, and covers directly, using minimal, chunked (4 KB) allocations instead of monolithic reads (previously up to 113+ KB in one block).
- Fixed the web server hanging/freezing under low-memory conditions. The upload and font-upload buffers now allocate heap only during an active transfer and free it immediately afterward, instead of permanently reserving static memory — eliminating the blocking behavior previously caused by heap exhaustion.
- Raised and tuned heap safety guards (
MaxAllocthresholds) before EPUB/cover operations, so the app now cleanly skips and retries low-memory operations instead of aborting. - Added an EXIF-thumbnail fallback for cover decoding when a full JPEG decode isn't possible due to memory pressure.
- Measured result: MinFree improved from ~8.4 KB to ~60 KB, and MaxAlloc improved from ~36 KB to ~94 KB during library navigation with 150 EPUBs.
📚 Library Improvements
- Real partial-screen rendering for cursor navigation (no more full-grid redraw flicker); selection border and title/author update instantly.
- Fixed grid centering, row/border misalignment, and stale border-erase bugs.
- Fixed placeholder titles disappearing during cover generation.
- Atomic, corruption-safe cover file writes (temp file + rename) to prevent partially-written thumbnails from being deleted mid-generation.
- Added page total to pagination display (e.g. "1/16 (144)").
- Removed redundant "update library" context menu entry and unnecessary full re-renders, improving responsiveness.
🧱 Code Quality
- Split the monolithic EPUB/library parsing code into dedicated modules (EpubParser, LibraryCache, LibraryActivity reorganized into clearly labeled sections) — no functional/behavioral changes, purely maintainability and future format-support improvements.