Skip to content

anv/allocator: try harder to memset() before anv_gem_close()

Paulo Zanoni requested to merge pzanoni/mesa:mem-barrier into main

The big comment above the memset() talks about how having that memset() before the anv_gem_close() call makes us safer. I can't see a reason why gcc wouldn't be allowed to actually swap the order of those two things, so add a memory barrier in order to try to enforce our intention.

I'm not entirely sure what race conditions we're trying to prevent here, especially since we have the mutex around everything. But still, let's make the code do what the comment tries to say it does.

Signed-off-by: Paulo Zanoni

Cc: @jekstrand

Merge request reports