mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-12-05 11:15:01 +03:00
The set_blob function bound the payload by reference. The sqlx encoder then copied the full payload into a new buffer. The function now moves the owned key, data and mime values into the query arguments. The SQL, the upsert behavior and the public signature do not change. A new single-test binary counts Rust heap requests with a global allocator. It also checks insert, overwrite, soft delete and revive. For an 8 MiB payload, the old code requested 8,393,257 bytes in one set_blob call, with one block at or above 1 MiB. The new code stays below 64 KiB and makes no block at or above 1 MiB.