r600g/sb: Fix memory leak by reworking uses list (rebased)
authorConstantine Kharlamov <Hi-Angel@yandex.ru>
Mon, 20 Mar 2017 18:16:25 +0000 (21:16 +0300)
committerMarek Olšák <marek.olsak@amd.com>
Mon, 20 Mar 2017 22:23:50 +0000 (23:23 +0100)
commit99d400b78f03ce33730b7ac8afa5077d6bb31893
tree2ead1dc3fa231414c32620a0182a8eb7b75b24fd
parent827ae79b2c6cf53e26b3467e4c3965ce6acab3c6
r600g/sb: Fix memory leak by reworking uses list (rebased)

The author is Heiko Przybyl(CC'ing), the patch is rebased on top of Bartosz Tomczyk's one per Dieter Nützel's comment.
Tested-by: Constantine Charlamov <Hi-Angel@yandex.ru>
v2: Resend the patch again through git-email. The prev. rebase was sent
through Thunderbird, which screwed up tab characters, making the patch
not apply.

--------------
When fixing the stalls on evergreen I introduced leaking of the useinfo
structure(s). Sorry. Instead of allocating a new object to hold 3 values
where only one is actually used, rework the list to just store the node
pointer. Thus no allocating and deallocation is needed. Since use_info
and use_kind aren't used anywhere, drop them and reduce code complexity.
This might also save some small amount of cycles.

Thanks to Bartosz Tomczyk for finding the bug.

Reported-by: Bartosz Tomczyk <bartosz.tomczyk86 at gmail.com <https://lists.freedesktop.org/mailman/listinfo/mesa-dev>>
Signed-off-by: Heiko Przybyl <lil_tux at web.de <https://lists.freedesktop.org/mailman/listinfo/mesa-dev>>
Supersedes: https://patchwork.freedesktop.org/patch/135852
Signed-off-by: Marek Olšák <marek.olsak@amd.com>
Tested-by: Dieter Nützel <Dieter@nuetzel-hh.de>
src/gallium/drivers/r600/sb/sb_def_use.cpp
src/gallium/drivers/r600/sb/sb_gcm.cpp
src/gallium/drivers/r600/sb/sb_ir.h
src/gallium/drivers/r600/sb/sb_valtable.cpp