i965: Allocate the screen using ralloc rather than calloc.
authorKenneth Graunke <kenneth@whitecape.org>
Mon, 17 Mar 2014 20:57:14 +0000 (13:57 -0700)
committerKenneth Graunke <kenneth@whitecape.org>
Tue, 18 Mar 2014 17:31:12 +0000 (10:31 -0700)
This will allow us to use the screen as a memory context.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
src/mesa/drivers/dri/i965/intel_screen.c

index 464cebf1e719fb6459da63ea51f58611824d3a24..35369220c8e70f8ff68077e8675ff57a254f90b8 100644 (file)
@@ -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;