mesa: overhaul debug namespace support
authorChia-I Wu <olvaffe@gmail.com>
Thu, 24 Apr 2014 03:17:32 +0000 (11:17 +0800)
committerChia-I Wu <olvaffe@gmail.com>
Sun, 27 Apr 2014 02:06:21 +0000 (10:06 +0800)
commit7b2dd89041f458e90e65c4bf1edb9ff9580cbaee
tree83c29a2ce8b4b400e8d256706ef1626ae8f02301
parent70e43370145d58f389627b11d075d8f6dbcf6ae3
mesa: overhaul debug namespace support

_mesa_HashTable is not well-suited for us: it locks a mutex unnecessarily and
it does not accept 0 as the key (and have branches to handle 1 specially).
What we really need is a sparse array.  Whether it should be implemented as a
hash table, a list, or a bsearch()-able array requires investigations of the
use models.

We choose to implement it as a list for now, assuming it is common to have a
short list of IDs in each (source, type) namespace.  The code is simpler, and
the memory footprint is lower.  This also fixes several corner cases such as
making messages to have different states at different severities.

v2: use GLbitfield for State/DefaultState, and add a comment

Signed-off-by: Chia-I Wu <olv@lunarg.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
src/mesa/main/errors.c