summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/mesa/drivers/dri/i915/i915_fragprog.c4
-rw-r--r--src/mesa/drivers/dri/i965/brw_program.c4
-rw-r--r--src/mesa/drivers/dri/r200/r200_vertprog.c5
-rw-r--r--src/mesa/program/program.c4
-rw-r--r--src/mesa/state_tracker/st_cb_program.c18
5 files changed, 21 insertions, 14 deletions
diff --git a/src/mesa/drivers/dri/i915/i915_fragprog.c b/src/mesa/drivers/dri/i915/i915_fragprog.c
index a57125412ea..2ad9eb23e75 100644
--- a/src/mesa/drivers/dri/i915/i915_fragprog.c
+++ b/src/mesa/drivers/dri/i915/i915_fragprog.c
@@ -1148,13 +1148,13 @@ i915NewProgram(struct gl_context * ctx, GLenum target, GLuint id)
{
switch (target) {
case GL_VERTEX_PROGRAM_ARB: {
- struct gl_program *prog = CALLOC_STRUCT(gl_program);
+ struct gl_program *prog = rzalloc(NULL, struct gl_program);
return _mesa_init_gl_program(prog, target, id);
}
case GL_FRAGMENT_PROGRAM_ARB:{
struct i915_fragment_program *prog =
- CALLOC_STRUCT(i915_fragment_program);
+ rzalloc(NULL, struct i915_fragment_program);
if (prog) {
i915_init_program(I915_CONTEXT(ctx), prog);
diff --git a/src/mesa/drivers/dri/i965/brw_program.c b/src/mesa/drivers/dri/i965/brw_program.c
index 8f015026421..647f138f0a3 100644
--- a/src/mesa/drivers/dri/i965/brw_program.c
+++ b/src/mesa/drivers/dri/i965/brw_program.c
@@ -135,7 +135,7 @@ static struct gl_program *brwNewProgram( struct gl_context *ctx,
case GL_TESS_EVALUATION_PROGRAM_NV:
case GL_GEOMETRY_PROGRAM_NV:
case GL_COMPUTE_PROGRAM_NV: {
- struct brw_program *prog = CALLOC_STRUCT(brw_program);
+ struct brw_program *prog = rzalloc(NULL, struct brw_program);
if (prog) {
prog->id = get_new_program_id(brw->screen);
@@ -149,7 +149,7 @@ static struct gl_program *brwNewProgram( struct gl_context *ctx,
struct brw_program *prog;
if (brw->gen < 6) {
struct gen4_fragment_program *g4_prog =
- CALLOC_STRUCT(gen4_fragment_program);
+ rzalloc(NULL, struct gen4_fragment_program);
prog = &g4_prog->base;
} else {
prog = CALLOC_STRUCT(brw_program);
diff --git a/src/mesa/drivers/dri/r200/r200_vertprog.c b/src/mesa/drivers/dri/r200/r200_vertprog.c
index 3f1d53e7270..5965c6e8048 100644
--- a/src/mesa/drivers/dri/r200/r200_vertprog.c
+++ b/src/mesa/drivers/dri/r200/r200_vertprog.c
@@ -1203,11 +1203,12 @@ r200NewProgram(struct gl_context *ctx, GLenum target, GLuint id)
{
switch(target){
case GL_VERTEX_PROGRAM_ARB: {
- struct r200_vertex_program *vp = CALLOC_STRUCT(r200_vertex_program);
+ struct r200_vertex_program *vp = rzalloc(NULL,
+ struct r200_vertex_program);
return _mesa_init_gl_program(&vp->mesa_program, target, id);
}
case GL_FRAGMENT_PROGRAM_ARB: {
- struct gl_program *prog = CALLOC_STRUCT(gl_program);
+ struct gl_program *prog = rzalloc(NULL, struct gl_program);
return _mesa_init_gl_program(prog, target, id);
}
default:
diff --git a/src/mesa/program/program.c b/src/mesa/program/program.c
index 3b7745b905a..f4b36f4cbf2 100644
--- a/src/mesa/program/program.c
+++ b/src/mesa/program/program.c
@@ -221,7 +221,7 @@ _mesa_new_program(struct gl_context *ctx, GLenum target, GLuint id)
case GL_TESS_EVALUATION_PROGRAM_NV:
case GL_FRAGMENT_PROGRAM_ARB:
case GL_COMPUTE_PROGRAM_NV: {
- struct gl_program *prog = CALLOC_STRUCT(gl_program);
+ struct gl_program *prog = rzalloc(NULL, struct gl_program);
return _mesa_init_gl_program(prog, target, id);
}
default:
@@ -262,7 +262,7 @@ _mesa_delete_program(struct gl_context *ctx, struct gl_program *prog)
}
mtx_destroy(&prog->Mutex);
- free(prog);
+ ralloc_free(prog);
}
diff --git a/src/mesa/state_tracker/st_cb_program.c b/src/mesa/state_tracker/st_cb_program.c
index 48720a3656e..77b7a263796 100644
--- a/src/mesa/state_tracker/st_cb_program.c
+++ b/src/mesa/state_tracker/st_cb_program.c
@@ -58,27 +58,33 @@ st_new_program(struct gl_context *ctx, GLenum target, GLuint id)
{
switch (target) {
case GL_VERTEX_PROGRAM_ARB: {
- struct st_vertex_program *prog = ST_CALLOC_STRUCT(st_vertex_program);
+ struct st_vertex_program *prog = rzalloc(NULL,
+ struct st_vertex_program);
return _mesa_init_gl_program(&prog->Base, target, id);
}
case GL_FRAGMENT_PROGRAM_ARB: {
- struct st_fragment_program *prog = ST_CALLOC_STRUCT(st_fragment_program);
+ struct st_fragment_program *prog = rzalloc(NULL,
+ struct st_fragment_program);
return _mesa_init_gl_program(&prog->Base, target, id);
}
case GL_GEOMETRY_PROGRAM_NV: {
- struct st_geometry_program *prog = ST_CALLOC_STRUCT(st_geometry_program);
+ struct st_geometry_program *prog = rzalloc(NULL,
+ struct st_geometry_program);
return _mesa_init_gl_program(&prog->Base, target, id);
}
case GL_TESS_CONTROL_PROGRAM_NV: {
- struct st_tessctrl_program *prog = ST_CALLOC_STRUCT(st_tessctrl_program);
+ struct st_tessctrl_program *prog = rzalloc(NULL,
+ struct st_tessctrl_program);
return _mesa_init_gl_program(&prog->Base, target, id);
}
case GL_TESS_EVALUATION_PROGRAM_NV: {
- struct st_tesseval_program *prog = ST_CALLOC_STRUCT(st_tesseval_program);
+ struct st_tesseval_program *prog = rzalloc(NULL,
+ struct st_tesseval_program);
return _mesa_init_gl_program(&prog->Base, target, id);
}
case GL_COMPUTE_PROGRAM_NV: {
- struct st_compute_program *prog = ST_CALLOC_STRUCT(st_compute_program);
+ struct st_compute_program *prog = rzalloc(NULL,
+ struct st_compute_program);
return _mesa_init_gl_program(&prog->Base, target, id);
}
default: