nouveau_vieux: use align_calloc for the context to fix m32 crashes
Fixes: 3175b63a0d
"mesa: don't allocate matrices with malloc"
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Zoltán Böszörményi <zboszor@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9220>
This commit is contained in:
parent
81cf4bef7e
commit
f827b29234
|
@ -134,7 +134,7 @@ nv04_context_destroy(struct gl_context *ctx)
|
|||
nouveau_object_del(&nctx->hw.surf3d);
|
||||
|
||||
nouveau_context_deinit(ctx);
|
||||
free(ctx);
|
||||
align_free(ctx);
|
||||
}
|
||||
|
||||
static struct gl_context *
|
||||
|
@ -147,7 +147,7 @@ nv04_context_create(struct nouveau_screen *screen, gl_api api,
|
|||
struct gl_context *ctx;
|
||||
int ret;
|
||||
|
||||
nctx = CALLOC_STRUCT(nv04_context);
|
||||
nctx = align_calloc(sizeof(struct nv04_context), 16);
|
||||
if (!nctx)
|
||||
return NULL;
|
||||
|
||||
|
|
|
@ -424,7 +424,7 @@ nv10_context_destroy(struct gl_context *ctx)
|
|||
nouveau_object_del(&nctx->hw.eng3d);
|
||||
|
||||
nouveau_context_deinit(ctx);
|
||||
free(ctx);
|
||||
align_free(ctx);
|
||||
}
|
||||
|
||||
static struct gl_context *
|
||||
|
@ -437,7 +437,7 @@ nv10_context_create(struct nouveau_screen *screen, gl_api api,
|
|||
unsigned celsius_class;
|
||||
int ret;
|
||||
|
||||
nctx = CALLOC_STRUCT(nouveau_context);
|
||||
nctx = align_calloc(sizeof(struct nouveau_context), 16);
|
||||
if (!nctx)
|
||||
return NULL;
|
||||
|
||||
|
|
|
@ -435,7 +435,7 @@ nv20_context_destroy(struct gl_context *ctx)
|
|||
nouveau_object_del(&nctx->hw.eng3d);
|
||||
|
||||
nouveau_context_deinit(ctx);
|
||||
free(ctx);
|
||||
align_free(ctx);
|
||||
}
|
||||
|
||||
static struct gl_context *
|
||||
|
@ -448,7 +448,7 @@ nv20_context_create(struct nouveau_screen *screen, gl_api api,
|
|||
unsigned kelvin_class;
|
||||
int ret;
|
||||
|
||||
nctx = CALLOC_STRUCT(nouveau_context);
|
||||
nctx = align_calloc(sizeof(struct nouveau_context), 16);
|
||||
if (!nctx)
|
||||
return NULL;
|
||||
|
||||
|
|
Loading…
Reference in New Issue