vc4: Switch the context struct to use ralloc.
authorEric Anholt <eric@anholt.net>
Mon, 22 Sep 2014 19:38:24 +0000 (12:38 -0700)
committerEric Anholt <eric@anholt.net>
Tue, 23 Sep 2014 20:40:10 +0000 (13:40 -0700)
I wanted to hang the ra_regs off it so I didn't have to free, but it
turned out it wasn't ralloced yet.

src/gallium/drivers/vc4/vc4_context.c

index 5133ecadff41aa49c71a86808cb0c307957b3d96..13f0ef0158c97fab00570cb8e2bbcac673e0a287 100644 (file)
@@ -25,6 +25,7 @@
 #include <err.h>
 
 #include "pipe/p_defines.h"
+#include "util/ralloc.h"
 #include "util/u_inlines.h"
 #include "util/u_memory.h"
 #include "util/u_blitter.h"
@@ -337,7 +338,7 @@ vc4_context_destroy(struct pipe_context *pctx)
 
         util_slab_destroy(&vc4->transfer_pool);
 
-        free(vc4);
+        ralloc_free(vc4);
 }
 
 struct pipe_context *
@@ -350,7 +351,7 @@ vc4_context_create(struct pipe_screen *pscreen, void *priv)
         uint32_t saved_shaderdb_flag = vc4_debug & VC4_DEBUG_SHADERDB;
         vc4_debug &= ~VC4_DEBUG_SHADERDB;
 
-        vc4 = CALLOC_STRUCT(vc4_context);
+        vc4 = rzalloc(NULL, struct vc4_context);
         if (vc4 == NULL)
                 return NULL;
         struct pipe_context *pctx = &vc4->base;