util/sparse_array: don't stomp head's counter on pop operations
authorD Scott Phillips <d.scott.phillips@intel.com>
Fri, 17 Apr 2020 17:28:06 +0000 (10:28 -0700)
committerMarge Bot <eric+marge@anholt.net>
Fri, 17 Apr 2020 18:41:40 +0000 (18:41 +0000)
commitdc3a17997b479f91f36b2421e9c41c11a025de47
tree3caa4d7654ba40b75d0571f6cd143823c9fc8efc
parentd684fb37bfbc47d098158cb03c0672119a4469fe
util/sparse_array: don't stomp head's counter on pop operations

By temporarily storing the new_head by a uint32_t, we wipe out the
counter section of the head pointer.

Fixes: e4f01eca ("util: Add a free list structure for use with util_sparse_array")
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Rafael Antognolli <rafael.antognolli@intel.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4612>
src/util/sparse_array.c