mirror of
https://github.com/libretro/RetroArch.git
synced 2026-11-22 10:50:15 -10:00
rmsgpack_read() takes each field from a window the stream lends with the new intfstream_view(), and reads only what the window does not hold. Buffered streams lend their window and file streams lend what filestream_view() lends. The stream is left where the value ends. Reading every entry of a 150,000-entry database through a cursor goes from 1.31 to 1.61 million entries a second, with the same values. The cursor is what the Explore menu and database lookups read through. rmsgpack_window_test writes values of every shape: integers of every width and sign, and strings and binaries up to past the reader's window. It reads them back through buffered streams with 4 KiB and 64-octet windows, a file stream mapped and not, and a memory stream, which lends nothing. Every value must match and the position must be right after each. It passes under ASan and UBSan.