mirror of
https://github.com/Droid-Deck/DroidDeck.git
synced 2026-11-24 23:36:04 +00:00
The handle maps use key 0 for an empty slot. vkDestroyBuffer, vkFreeMemory and the other destroy calls accept VK_NULL_HANDLE, and map_remove(0) matched the first empty slot it reached, so every such call lowered count without removing anything. Once count wrapped below zero, every map_put saw a full table and doubled it, and each rehash took twice as long as the one before. Steam's web helper frees null buffers about 50,000 times in a few minutes. On a Mali-G610 its UI stalled periodically for 0.2 s, 0.37 s, 0.75 s, 1.5 s and then 3 s, and the buffer map reported a count of 4294967295. map_get, map_put and map_remove now ignore key 0. On a Nothing Phone (2a) running 0.7.1 with this change, the buffer map stayed at 256 slots after 115,000 frees and the stalls were gone.