Commit Graph

7 Commits

Author SHA1 Message Date
Jason Ekstrand 4c99e3ae78 util: Move main/set to util/hash_set
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2015-01-15 13:21:27 -08:00
Kenneth Graunke 1e0da6233b util: Move ralloc to a new src/util directory.
For a long time, we've wanted a place to put utility code which isn't
directly tied to Mesa or Gallium internals.  This patch creates a new
src/util directory for exactly that purpose, and builds the contents as
libmesautil.la.

ralloc seemed like a good first candidate.  These days, it's directly
used by mesa/main, i965, i915, and r300g, so keeping it in src/glsl
didn't make much sense.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>

v2 (Jason Ekstrand): More realloc uses and some scons fixes

Signed-off-by: Jason Ekstrand <jason.ekstrand@intel.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2014-08-04 11:06:58 -07:00
Kenneth Graunke 378c6f2246 mesa: Drop unused hash_table::mem_ctx field.
It's never used, and it's equivalent to ralloc_parent(ht) if you really
need it.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2014-03-06 20:55:34 -08:00
Brian Paul 738337356b mesa: fix inconsistent function declaration, definitions
To silence MSVC warnings that the declaration and definitions
were different.
2013-07-12 08:19:49 -06:00
Paul Berry a4b9678a54 Consolidate some redundant definitions of ARRAY_SIZE() macro.
Previous to this patch, there were 13 identical definitions of this
macro in Mesa source.  That's ridiculous.  This patch consolidates 6
of them to a single definition in src/mesa/main/macros.h.

Unfortunately, I wasn't able to eliminate the remaining definitions,
since they occur in places that don't include src/mesa/main/macros.h:

- include/pci_ids/pci_id_driver_map.h
- src/egl/drivers/dri2/egl_dri2.h
- src/egl/main/egldefines.h
- src/gbm/main/backend.c
- src/gbm/main/gbm.c
- src/glx/glxclient.h
- src/mapi/mapi/stub.c

I'm open to suggestions as to how to deal with the remaining redundancy.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-02-08 06:51:22 -08:00
Brian Paul 7745596ceb mesa: use rand() instead of random()
As Vinson Lee did in commit bb284669f8
in hash_table.c

Signed-off-by: Brian Paul <brianp@vmware.com>
2012-12-06 11:55:02 -07:00
Eric Anholt 82c9d98ab9 mesa: add set support (stores a set of pointers)
From: git://people.freedesktop.org/~anholt/hash_table

Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
[jordan.l.justen@intel.com: minor rework for mesa]
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-12-06 09:43:07 -08:00