radv,zink,st/mesa: use _mesa_set_fini instead of ralloc_free

This is the correct way to free the set.

Reviewed-by: Gert Wollny <gert.wollny@collabora.com>
Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36728>
This commit is contained in:
Marek Olšák 2025-08-09 23:37:36 -04:00 committed by Marge Bot
parent 9efee5f75f
commit c12118decf
7 changed files with 9 additions and 10 deletions

View file

@ -298,8 +298,8 @@ radv_emit_clear_data(struct radv_cmd_buffer *cmd_buffer, unsigned engine_sel, ui
static void
radv_cmd_buffer_finish_shader_part_cache(struct radv_cmd_buffer *cmd_buffer)
{
ralloc_free(cmd_buffer->vs_prologs.table);
ralloc_free(cmd_buffer->ps_epilogs.table);
_mesa_set_fini(&cmd_buffer->vs_prologs, NULL);
_mesa_set_fini(&cmd_buffer->ps_epilogs, NULL);
}
static bool

View file

@ -2886,7 +2886,7 @@ radv_shader_part_cache_finish(struct radv_device *device, struct radv_shader_par
set_foreach (&cache->entries, entry)
radv_shader_part_unref(device, radv_shader_part_from_cache_entry(entry->key));
simple_mtx_destroy(&cache->lock);
ralloc_free(cache->entries.table);
_mesa_set_fini(&cache->entries, NULL);
}
/*

View file

@ -6029,7 +6029,7 @@ trivial_revectorize(nir_shader *nir)
nir_instr *instr = (void*)entry->key;
nir_instr_remove(instr);
}
ralloc_free(deletions.table);
_mesa_set_fini(&deletions, NULL);
return progress;
}

View file

@ -1035,7 +1035,7 @@ zink_gfx_lib_cache_unref(struct zink_screen *screen, struct zink_gfx_lib_cache *
VKSCR(DestroyPipeline)(screen->dev, gkey->pipeline, NULL);
FREE(gkey);
}
ralloc_free(libs->libs.table);
_mesa_set_fini(&libs->libs, NULL);
FREE(libs);
}

View file

@ -207,14 +207,14 @@ zink_destroy_resource_surface_cache(struct zink_screen *screen, struct set *ht,
VKSCR(DestroyBufferView)(screen->dev, bv->buffer_view, NULL);
FREE(bv);
}
ralloc_free(ht->table);
_mesa_set_fini(ht, NULL);
} else {
set_foreach_remove(ht, he) {
struct zink_surface *surf = (void*)he->key;
VKSCR(DestroyImageView)(screen->dev, surf->image_view, NULL);
FREE(surf);
}
ralloc_free(ht->table);
_mesa_set_fini(ht, NULL);
}
}

View file

@ -1539,8 +1539,7 @@ zink_destroy_screen(struct pipe_screen *pscreen)
}
}
if (!device_table.entries) {
ralloc_free(device_table.table);
device_table.table = NULL;
_mesa_set_fini(&device_table, NULL);
}
simple_mtx_unlock(&device_lock);
}

View file

@ -1360,7 +1360,7 @@ st_pbo_compute_deinit(struct st_context *st)
}
free(spec);
}
ralloc_free(async->specialized.table);
_mesa_set_fini(&async->specialized, NULL);
free(async);
} else {
st->pipe->delete_compute_state(st->pipe, entry->data);