ralloc: Delete autofree handling.
There was exactly one user of this, and I just removed it. It also accessed an implicit global context, with no locking. This meant that it was only safe if all callers of ralloc_autofree_context() held the same lock...which is a pretty terrible thing for a utility library to impose. Signed-off-by: Kenneth Graunke <kenneth@whitecape.org> Reviewed-by: Marek Olšák <marek.olsak@amd.com> Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
This commit is contained in:
@@ -323,24 +323,6 @@ ralloc_parent(const void *ptr)
|
||||
return info->parent ? PTR_FROM_HEADER(info->parent) : NULL;
|
||||
}
|
||||
|
||||
static void *autofree_context = NULL;
|
||||
|
||||
static void
|
||||
autofree(void)
|
||||
{
|
||||
ralloc_free(autofree_context);
|
||||
}
|
||||
|
||||
void *
|
||||
ralloc_autofree_context(void)
|
||||
{
|
||||
if (unlikely(autofree_context == NULL)) {
|
||||
autofree_context = ralloc_context(NULL);
|
||||
atexit(autofree);
|
||||
}
|
||||
return autofree_context;
|
||||
}
|
||||
|
||||
void
|
||||
ralloc_set_destructor(const void *ptr, void(*destructor)(void *))
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user