mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-25 13:00:09 +01:00
Cell: use mem_dup()
This commit is contained in:
parent
f12d641ab2
commit
c0235d0a24
2 changed files with 3 additions and 10 deletions
|
|
@ -39,9 +39,7 @@ void *
|
|||
cell_create_blend_state(struct pipe_context *pipe,
|
||||
const struct pipe_blend_state *blend)
|
||||
{
|
||||
struct pipe_blend_state *state = MALLOC(sizeof(struct pipe_blend_state));
|
||||
memcpy(state, blend, sizeof(struct pipe_blend_state));
|
||||
return state;
|
||||
return mem_dup(blend, sizeof(*blend));
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -85,10 +83,7 @@ void *
|
|||
cell_create_depth_stencil_alpha_state(struct pipe_context *pipe,
|
||||
const struct pipe_depth_stencil_alpha_state *depth_stencil)
|
||||
{
|
||||
struct pipe_depth_stencil_alpha_state *state =
|
||||
MALLOC(sizeof(struct pipe_depth_stencil_alpha_state));
|
||||
memcpy(state, depth_stencil, sizeof(struct pipe_depth_stencil_alpha_state));
|
||||
return state;
|
||||
return mem_dup(depth_stencil, sizeof(*depth_stencil));
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -40,9 +40,7 @@ void *
|
|||
cell_create_sampler_state(struct pipe_context *pipe,
|
||||
const struct pipe_sampler_state *sampler)
|
||||
{
|
||||
struct pipe_sampler_state *state = MALLOC( sizeof(struct pipe_sampler_state) );
|
||||
memcpy(state, sampler, sizeof(struct pipe_sampler_state));
|
||||
return state;
|
||||
return mem_dup(sampler, sizeof(*sampler));
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue