summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKenneth Graunke <[email protected]>2014-03-17 13:57:14 -0700
committerKenneth Graunke <[email protected]>2014-03-18 10:31:12 -0700
commitb3e4b769dd318936abc38acbbbdec61ae2539e84 (patch)
tree9557fb9aa8f8c6cbaf9f2f031c659555834bdede
parent41097db91bb18cfb03faf00d9bc7a5495d1bf66e (diff)
i965: Allocate the screen using ralloc rather than calloc.
This will allow us to use the screen as a memory context. Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
-rw-r--r--src/mesa/drivers/dri/i965/intel_screen.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/mesa/drivers/dri/i965/intel_screen.c b/src/mesa/drivers/dri/i965/intel_screen.c
index 464cebf1e71..35369220c8e 100644
--- a/src/mesa/drivers/dri/i965/intel_screen.c
+++ b/src/mesa/drivers/dri/i965/intel_screen.c
@@ -37,6 +37,7 @@
#include "main/fbobject.h"
#include "main/version.h"
#include "swrast/s_renderbuffer.h"
+#include "glsl/ralloc.h"
#include "utils.h"
#include "xmlpool.h"
@@ -946,7 +947,7 @@ intelDestroyScreen(__DRIscreen * sPriv)
dri_bufmgr_destroy(intelScreen->bufmgr);
driDestroyOptionInfo(&intelScreen->optionCache);
- free(intelScreen);
+ ralloc_free(intelScreen);
sPriv->driverPrivate = NULL;
}
@@ -1311,7 +1312,7 @@ __DRIconfig **intelInitScreen2(__DRIscreen *psp)
}
/* Allocate the private area */
- intelScreen = calloc(1, sizeof *intelScreen);
+ intelScreen = rzalloc(NULL, struct intel_screen);
if (!intelScreen) {
fprintf(stderr, "\nERROR! Allocating private area failed\n");
return false;