[Mesa-dev] [PATCH] st/mesa: fix sampler_view REALLOC/FREE macro mix-up

Jakob Bornecrantz wallbraker at gmail.com
Thu Apr 10 08:53:04 PDT 2014


On 10 Apr 2014 15:56, "Brian Paul" <brianp at vmware.com> wrote:
>
> 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.

Ah fair enough.

Cheers, Jakob.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/mesa-dev/attachments/20140410/c9951cad/attachment.html>


More information about the mesa-dev mailing list