[Mesa-dev] [PATCH 4/5] ra: Don't use regs as the ralloc context.

Jason Ekstrand jason at jlekstrand.net
Wed Nov 26 11:03:34 PST 2014


On Wed, Nov 26, 2014 at 10:59 AM, Matt Turner <mattst88 at gmail.com> wrote:

> On Wed, Nov 26, 2014 at 10:56 AM, Jason Ekstrand <jason at jlekstrand.net>
> wrote:
> > On Wed, Nov 26, 2014 at 10:39 AM, Matt Turner <mattst88 at gmail.com>
> wrote:
> >>
> >> The i965 backends pass something out of 'screen', which is allocated
> >> per-process, making using this as a ralloc context not thread-safe.
> >>
> >> All callers ra_alloc_interference_graph() already ralloc_free() its
> >> return value.
> >> ---
> >>  src/util/register_allocate.c | 2 +-
> >>  1 file changed, 1 insertion(+), 1 deletion(-)
> >>
> >> diff --git a/src/util/register_allocate.c b/src/util/register_allocate.c
> >> index 6cf7ce7..1cfd66f 100644
> >> --- a/src/util/register_allocate.c
> >> +++ b/src/util/register_allocate.c
> >> @@ -374,7 +374,7 @@ ra_alloc_interference_graph(struct ra_regs *regs,
> >> unsigned int count)
> >>     struct ra_graph *g;
> >>     unsigned int i;
> >>
> >> -   g = rzalloc(regs, struct ra_graph);
> >> +   g = rzalloc(NULL, struct ra_graph);
> >
> >
> > Why not make ra_alloc_interference_graph take a ralloc context?
>
> I mean, I could, but why? All callers of ra_alloc_interference_graph()
> ralloc_free its result themselves.
>

Sure.  It doesn't much matter.  It just gives us the option.  I don't care
much either way.  This one is
Reviewed-by: Jason Ekstrand <jason.ekstrand at intel.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/mesa-dev/attachments/20141126/1766e4b0/attachment.html>


More information about the mesa-dev mailing list