{
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);
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);
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);
{
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:
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:
}
mtx_destroy(&prog->Mutex);
- free(prog);
+ ralloc_free(prog);
}
{
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: