On Mon, Aug 29, 2016 at 7:23 PM, Emil Velikov <emil.l.veli...@gmail.com> wrote: > On 29 August 2016 at 16:29, Marek Olšák <mar...@gmail.com> wrote: >> From: Marek Olšák <marek.ol...@amd.com> >> >> --- >> src/gallium/drivers/noop/noop_state.c | 56 >> +++++------------------------------ >> 1 file changed, 7 insertions(+), 49 deletions(-) >> >> diff --git a/src/gallium/drivers/noop/noop_state.c >> b/src/gallium/drivers/noop/noop_state.c >> index 0c0ad9f..01538bfe27 100644 >> --- a/src/gallium/drivers/noop/noop_state.c >> +++ b/src/gallium/drivers/noop/noop_state.c >> @@ -35,63 +35,39 @@ static void noop_draw_vbo(struct pipe_context *ctx, >> const struct pipe_draw_info >> } >> >> static void noop_set_blend_color(struct pipe_context *ctx, >> const struct pipe_blend_color *state) >> { >> } >> >> static void *noop_create_blend_state(struct pipe_context *ctx, >> const struct pipe_blend_state *state) >> { >> - struct pipe_blend_state *nstate = CALLOC_STRUCT(pipe_blend_state); >> - >> - if (!nstate) { >> - return NULL; >> - } >> - *nstate = *state; >> - return nstate; >> + return malloc(1); > You want to use [CM]ALLOC to match the FREE. > > Mildly related: > Is the allocator doing to do something special for the 1 byte case or > it's going to threat it like any other "smaller than bucket size" ?
I have no idea, and I'm not concerned about that. Marek _______________________________________________ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-dev