util: Use linear parent to (r)allocated extra nodes
authorCaio Oliveira <caio.oliveira@intel.com>
Mon, 18 Sep 2023 02:15:42 +0000 (19:15 -0700)
committerMarge Bot <emma+marge@anholt.net>
Mon, 25 Sep 2023 17:26:17 +0000 (17:26 +0000)
commit4519421db5f9863d380994cedafcd489ade9d715
tree3bb56c06944651488bf0cf942e67361a8caa84b5
parent6764689e0e4f967039b9c77c729c9389ed42ac11
util: Use linear parent to (r)allocated extra nodes

Instead of making all the nodes children of the same original
ralloc_ctx, use that context just for the first node (which
is the linear parent).  The remaining nodes are (r)allocated
using the first one.

With that change, to free/steal, it is sufficient to apply the
operation to the first node, which uses the underlying linked
list between the nodes at ralloc level.  And we can remove
the 'next' pointer in linear_header, now unused.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25280>
src/util/ralloc.c