[Mesa-dev] [PATCH 1/9] ralloc: Allow reparenting to a NULL context

Kenneth Graunke kenneth at whitecape.org
Thu Aug 17 23:05:36 UTC 2017


On Thursday, August 17, 2017 10:22:15 AM PDT Jason Ekstrand wrote:
> ---
>  src/util/ralloc.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/src/util/ralloc.c b/src/util/ralloc.c
> index bf46439..4015c7e 100644
> --- a/src/util/ralloc.c
> +++ b/src/util/ralloc.c
> @@ -285,7 +285,7 @@ ralloc_steal(const void *new_ctx, void *ptr)
>        return;
>  
>     info = get_header(ptr);
> -   parent = get_header(new_ctx);
> +   parent = new_ctx ? get_header(new_ctx) : NULL;
>  
>     unlink_block(info);
>  
> 

This patch is:
Reviewed-by: Kenneth Graunke <kenneth at whitecape.org>

ralloc_adopt() doesn't properly handle NULL either, but frankly...
reparenting an unknown set of children to the NULL context sounds like a
recipe for leaks.  :)  So I'm not sure it's worth fixing.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: This is a digitally signed message part.
URL: <https://lists.freedesktop.org/archives/mesa-dev/attachments/20170817/b97e9550/attachment.sig>


More information about the mesa-dev mailing list