[Mesa-dev] [PATCH] st/mesa: fix sampler_view REALLOC/FREE macro mix-up
Brian Paul
brianp at vmware.com
Thu Apr 10 06:56:53 PDT 2014
On 04/10/2014 01:43 AM, Jakob Bornecrantz wrote:
> On Thu, Apr 10, 2014 at 3:26 AM, Brian Paul <brianp at vmware.com> wrote:
>> We were using REALLOC() from u_memory.h but FREE() from imports.h.
>> This mismatch caused us to trash the heap on Windows after we
>> deleted a texture object.
>>
>> This fixes a regression from commit 6c59be7776e4d.
>> ---
>> src/mesa/state_tracker/st_cb_texture.c | 2 +-
>> src/mesa/state_tracker/st_texture.c | 12 ++++++++++++
>> src/mesa/state_tracker/st_texture.h | 3 +++
>> 3 files changed, 16 insertions(+), 1 deletion(-)
>
> Is this patch obsoleted by the FREE/MALLOC remove series?
Not exactly. If I try to use FREE(stObj->sampler_views) in
st_cb_texture.c I need to include "u_memory.h". But then I get
preprocessor warnings about MALLOC_STRUCT() and CALLOC_STRUCT() being
redefined. So then I need to insert some #undef MALLOC_STRUCT lines.
It's just messy.
-Brian
More information about the mesa-dev
mailing list