r600/sfn: fix container allocators
authorGert Wollny <gert.wollny@collabora.com>
Tue, 4 Apr 2023 13:58:27 +0000 (15:58 +0200)
committerMarge Bot <emma+marge@anholt.net>
Wed, 5 Apr 2023 07:50:34 +0000 (07:50 +0000)
This fixes leaks in TexInstr and in Shader.

Thanks to Patrick Lerda for pointing out the bug.

Fixes: 79ca456b4837b3bc21cf9ef3c03c505c4b4909f6
    r600/sfn: rewrite NIR backend

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22300>

src/gallium/drivers/r600/sfn/sfn_instr_tex.h
src/gallium/drivers/r600/sfn/sfn_shader.h

index 777e038..9c97537 100644 (file)
@@ -198,7 +198,7 @@ private:
    unsigned m_resource_id;
 
    static const std::map<Opcode, std::string> s_opcode_map;
-   std::list<TexInstr *> m_prepare_instr;
+   std::list<TexInstr *, Allocator<TexInstr *>> m_prepare_instr;
 };
 
 bool
index 3263155..6197a41 100644 (file)
@@ -340,12 +340,14 @@ private:
    uint32_t m_indirect_files{0};
    std::bitset<sh_flags_count> m_flags;
    uint32_t nhwatomic_ranges{0};
-   std::vector<r600_shader_atomic> m_atomics;
+   std::vector<r600_shader_atomic, Allocator<r600_shader_atomic>> m_atomics;
 
    uint32_t m_nhwatomic{0};
    uint32_t m_atomic_base{0};
    uint32_t m_next_hwatomic_loc{0};
-   std::unordered_map<int, int> m_atomic_base_map;
+   std::unordered_map<int, int,
+                      std::hash<int>,  std::equal_to<int>,
+                      Allocator<std::pair<const int, int>>> m_atomic_base_map;
    uint32_t m_atomic_file_count{0};
    PRegister m_atomic_update{nullptr};
    PRegister m_rat_return_address{nullptr};