Mesa (master): ra: Don't use regs as the ralloc context.

Matt Turner mattst88 at kemper.freedesktop.org
Mon Dec 1 19:42:42 UTC 2014


Module: Mesa
Branch: master
Commit: 2e007fd621dba6e298c67e8bd1a8f26a4b6dc984
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=2e007fd621dba6e298c67e8bd1a8f26a4b6dc984

Author: Matt Turner <mattst88 at gmail.com>
Date:   Thu Nov 20 23:46:03 2014 -0800

ra: Don't use regs as the ralloc context.

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.

Reviewed-by: Jason Ekstrand <jason.ekstrand at intel.com>

---

 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);
    g->regs = regs;
    g->nodes = rzalloc_array(g, struct ra_node, count);
    g->count = count;




More information about the mesa-commit mailing list