diff options
author | Eric Anholt <[email protected]> | 2014-12-13 16:40:54 -0800 |
---|---|---|
committer | Eric Anholt <[email protected]> | 2014-12-14 23:11:59 -0800 |
commit | c84306fdc2f2f1aefd7c526e92d66fafda5b306c (patch) | |
tree | 716fc46f0700a99036aae1f4877d3845e3f330a6 /src/gallium/drivers | |
parent | f519c3bff14dfc4555c511a4d3709affa056d688 (diff) |
vc4: Fix leak of simulator memory on screen cleanup.
Diffstat (limited to 'src/gallium/drivers')
-rw-r--r-- | src/gallium/drivers/vc4/vc4_screen.c | 5 | ||||
-rw-r--r-- | src/gallium/drivers/vc4/vc4_simulator.c | 4 |
2 files changed, 6 insertions, 3 deletions
diff --git a/src/gallium/drivers/vc4/vc4_screen.c b/src/gallium/drivers/vc4/vc4_screen.c index 18451bd71a7..7a1840aaf4c 100644 --- a/src/gallium/drivers/vc4/vc4_screen.c +++ b/src/gallium/drivers/vc4/vc4_screen.c @@ -30,6 +30,7 @@ #include "util/u_debug.h" #include "util/u_memory.h" #include "util/u_format.h" +#include "util/ralloc.h" #include "vc4_screen.h" #include "vc4_context.h" @@ -75,7 +76,7 @@ vc4_screen_get_vendor(struct pipe_screen *pscreen) static void vc4_screen_destroy(struct pipe_screen *pscreen) { - free(pscreen); + ralloc_free(pscreen); } static int @@ -402,7 +403,7 @@ vc4_screen_is_format_supported(struct pipe_screen *pscreen, struct pipe_screen * vc4_screen_create(int fd) { - struct vc4_screen *screen = CALLOC_STRUCT(vc4_screen); + struct vc4_screen *screen = ralloc(NULL, struct vc4_screen); struct pipe_screen *pscreen; pscreen = &screen->base; diff --git a/src/gallium/drivers/vc4/vc4_simulator.c b/src/gallium/drivers/vc4/vc4_simulator.c index bb4a669e8f5..ee4ad96123b 100644 --- a/src/gallium/drivers/vc4/vc4_simulator.c +++ b/src/gallium/drivers/vc4/vc4_simulator.c @@ -24,6 +24,7 @@ #ifdef USE_VC4_SIMULATOR #include "util/u_memory.h" +#include "util/ralloc.h" #include "vc4_screen.h" #include "vc4_context.h" @@ -191,7 +192,8 @@ void vc4_simulator_init(struct vc4_screen *screen) { screen->simulator_mem_size = 256 * 1024 * 1024; - screen->simulator_mem_base = malloc(screen->simulator_mem_size); + screen->simulator_mem_base = ralloc_size(screen, + screen->simulator_mem_size); /* We supply our own memory so that we can have more aperture * available (256MB instead of simpenrose's default 64MB). |