diff --git a/.pick_status.json b/.pick_status.json index 79ee88fa174..f364e14d9fb 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -769,7 +769,7 @@ "description": "radeon,r200: use align_calloc for the context to fix m32 crashes", "nominated": true, "nomination_type": 1, - "resolution": 0, + "resolution": 1, "master_sha": null, "because_sha": "3175b63a0dfa290430f9f7eb651387788933a02b" }, diff --git a/src/mesa/drivers/dri/r200/r200_context.c b/src/mesa/drivers/dri/r200/r200_context.c index efcf9863848..e804451a76a 100644 --- a/src/mesa/drivers/dri/r200/r200_context.c +++ b/src/mesa/drivers/dri/r200/r200_context.c @@ -66,6 +66,7 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #include "utils.h" #include "util/driconf.h" /* for symbolic values of enum-type options */ +#include "util/u_memory.h" /* Return various strings for glGetString(). */ @@ -200,7 +201,7 @@ GLboolean r200CreateContext( gl_api api, assert(screen); /* Allocate the R200 context */ - rmesa = calloc(1, sizeof(*rmesa)); + rmesa = align_calloc(sizeof(*rmesa), 16); if ( !rmesa ) { *error = __DRI_CTX_ERROR_NO_MEMORY; return GL_FALSE; @@ -238,7 +239,7 @@ GLboolean r200CreateContext( gl_api api, if (!radeonInitContext(&rmesa->radeon, api, &functions, glVisual, driContextPriv, sharedContextPrivate)) { - free(rmesa); + align_free(rmesa); *error = __DRI_CTX_ERROR_NO_MEMORY; return GL_FALSE; } diff --git a/src/mesa/drivers/dri/radeon/radeon_common_context.c b/src/mesa/drivers/dri/radeon/radeon_common_context.c index 622b38ecc36..fbe8b8ed5d3 100644 --- a/src/mesa/drivers/dri/radeon/radeon_common_context.c +++ b/src/mesa/drivers/dri/radeon/radeon_common_context.c @@ -45,6 +45,7 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #include "swrast/swrast.h" #include "swrast_setup/swrast_setup.h" #include "tnl/tnl.h" +#include "util/u_memory.h" #ifndef RADEON_DEBUG int RADEON_DEBUG = (0); @@ -286,7 +287,7 @@ void radeonDestroyContext(__DRIcontext *driContextPriv ) fclose(track); } #endif - free(radeon); + align_free(radeon); } /* Force the context `c' to be unbound from its buffer. diff --git a/src/mesa/drivers/dri/radeon/radeon_context.c b/src/mesa/drivers/dri/radeon/radeon_context.c index 3c809630524..497a566cd24 100644 --- a/src/mesa/drivers/dri/radeon/radeon_context.c +++ b/src/mesa/drivers/dri/radeon/radeon_context.c @@ -67,6 +67,7 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #include "utils.h" #include "util/driconf.h" /* for symbolic values of enum-type options */ +#include "util/u_memory.h" extern const struct tnl_pipeline_stage _radeon_render_stage; extern const struct tnl_pipeline_stage _radeon_tcl_stage; @@ -165,7 +166,7 @@ r100CreateContext( gl_api api, assert(screen); /* Allocate the Radeon context */ - rmesa = calloc(1, sizeof(*rmesa)); + rmesa = align_calloc(sizeof(*rmesa), 16); if ( !rmesa ) { *error = __DRI_CTX_ERROR_NO_MEMORY; return GL_FALSE; @@ -200,7 +201,7 @@ r100CreateContext( gl_api api, if (!radeonInitContext(&rmesa->radeon, api, &functions, glVisual, driContextPriv, sharedContextPrivate)) { - free(rmesa); + align_free(rmesa); *error = __DRI_CTX_ERROR_NO_MEMORY; return GL_FALSE; }