mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-01-31 17:50:35 +01:00
Using address of drawable as hash table key will cause memory issue in this situation: 1. drawable A with address addr is destroyed and deleted from the hash table. 2. drawable B with same address addr is created and added to the hash table right after 1 is done. 3. st_framebuffers_purge will seach the hash table with drawable addr that associated with each framebuffer. If drawable is not in the hash table, then free this framebuffer. So when drawable B is created, then the framebuffer that associated with drawable A will not be freed in time. This will cause framebuffer memory leak. Since drawable->ID is unique, this uses drawable-ID as pre-hash to store drawable in hash table. This also removes key_hash_function because we already use drawable-ID as pre-hash when insert the data and we need to avoid assert of _mesa_hash_table_search_pre_hashed fail. Signed-off-by: Julia Zhang <Julia.Zhang@amd.com> Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31161> |
||
|---|---|---|
| .. | ||
| main | ||
| math | ||
| program | ||
| state_tracker | ||
| vbo | ||
| x86 | ||
| meson.build | ||