mesa/src/util
Nicolai Hähnle de8a919702 u_dynarray: turn util_dynarray_{grow, resize} into element-oriented macros
The main motivation for this change is API ergonomics: most operations
on dynarrays are really on elements, not on bytes, so it's weird to have
grow and resize as the odd operations out.

The secondary motivation is memory safety. Users of the old byte-oriented
functions would often multiply a number of elements with the element size,
which could overflow, and checking for overflow is tedious.

With this change, we only need to implement the overflow checks once.
The checks are cheap: since eltsize is a compile-time constant and the
functions should be inlined, they only add a single comparison and an
unlikely branch.

v2:
- ensure operations are no-op when allocation fails
- in util_dynarray_clone, call resize_bytes with a compile-time constant element size

v3:
- fix iris, lima, panfrost

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2019-06-12 18:30:25 -04:00
..
sha1
tests util: Add a helper for faster remainders 2019-05-31 19:14:27 +02:00
xmlpool v3d: Use driconf to expose non-MSAA texture limits for Xorg. 2019-05-13 12:03:11 -07:00
00-mesa-defaults.conf radeonsi: add drirc workaround for American Truck Simulator 2019-05-28 08:47:44 +10:00
Android.mk android: static link with libexpat with Android O+ 2019-03-25 10:11:57 +02:00
bigmath.h
bitscan.c
bitscan.h
bitset.h util/bitset: fix bitset range mask calculations. 2019-05-03 15:23:04 +10:00
bitset_test.cpp util/tests: add basic unit tests for bitset 2019-05-03 15:23:04 +10:00
build_id.c
build_id.h util: add missing include to build_id.h 2019-05-20 10:24:23 +10:00
crc32.c
crc32.h
dag.c util: Add a DAG datastructure. 2019-03-11 13:13:52 -07:00
dag.h util: Add a DAG datastructure. 2019-03-11 13:13:52 -07:00
debug.c nir: check NIR_SKIP to skip passes by name 2019-01-18 12:31:49 -08:00
debug.h nir: check NIR_SKIP to skip passes by name 2019-01-18 12:31:49 -08:00
disk_cache.c util/disk_cache: close fd in the fallback path 2019-03-28 16:41:27 +00:00
disk_cache.h util: Change remaining uint32 cache ids to sha1 2018-10-26 14:49:22 +11:00
fast_idiv_by_const.c
fast_idiv_by_const.h
fast_urem_by_const.h util: Add a helper for faster remainders 2019-05-31 19:14:27 +02:00
format_r11g11b10f.h
format_rgb9e5.h
format_srgb.h
format_srgb.py
futex.h util/futex: fix dangling pointer use 2019-06-12 17:27:44 +01:00
half_float.c
half_float.h
hash_table.c util/hash_table: Assert that keys are not reserved pointers 2019-06-06 00:27:53 +00:00
hash_table.h util/hash_table: Use fast modulo computation 2019-05-31 19:14:35 +02:00
list.h list: add some iterator debug 2019-05-30 22:11:26 +00:00
macros.h util: move BITFIELD macros to util/macros.h 2019-02-08 02:54:56 +00:00
Makefile.sources util: add os_read_file() helper 2019-04-30 15:40:33 +00:00
merge_driinfo.py radeonsi: add si_debug_options for convenient adding/removing of options 2019-04-25 12:31:02 +02:00
mesa-sha1.c
mesa-sha1.h
mesa-sha1_test.c
meson.build util: Add a helper for faster remainders 2019-05-31 19:14:27 +02:00
os_file.c util/os_file: suppress sign comparison warning 2019-06-09 13:14:13 +00:00
os_file.h util: add os_read_file() helper 2019-04-30 15:40:33 +00:00
os_memory.h util: promote u_memory to src/util 2018-11-27 15:44:02 -05:00
os_memory_aligned.h util: promote u_memory to src/util 2018-11-27 15:44:02 -05:00
os_memory_debug.h util: promote u_memory to src/util 2018-11-27 15:44:02 -05:00
os_memory_stdc.h util: promote u_memory to src/util 2018-11-27 15:44:02 -05:00
os_misc.c util/os_misc: Add check for PIPE_OS_HURD 2019-02-27 14:56:48 +00:00
os_misc.h util: Move os_misc to util 2018-10-30 14:32:52 -07:00
os_time.c
os_time.h
ralloc.c util/ralloc: Add helpers for growing zero-initialized memory 2019-05-14 12:30:22 -05:00
ralloc.h util/ralloc: Add helpers for growing zero-initialized memory 2019-05-14 12:30:22 -05:00
rand_xor.c
rand_xor.h
rb_tree.c
rb_tree.h
register_allocate.c util/ra: Assert nodes are in-bounds in add_node_interference 2019-05-14 12:30:22 -05:00
register_allocate.h util/ra: Add a helper for resetting a node's interference 2019-05-14 12:30:22 -05:00
rgtc.c
rgtc.h
roundeven_test.c
rounding.h
SConscript
set.c util/set: Assert that keys are not reserved pointers 2019-06-06 00:27:53 +00:00
set.h util/set: Use fast modulo computation 2019-05-31 19:14:30 +02:00
simple_list.h
simple_mtx.h
slab.c Change a few frequented uses of DEBUG to !NDEBUG 2019-05-29 21:13:35 -04:00
slab.h util/slab: Rename slab_mempool typed parameters to mempool 2018-12-14 07:36:05 -08:00
string_buffer.c
string_buffer.h
strndup.h
strtod.c
strtod.h
texcompress_rgtc_tmp.h
u_atomic.c
u_atomic.h
u_atomic_test.c
u_cpu_detect.c gallium: Enable ASIMD/NEON on aarch64. 2019-01-24 11:07:24 -08:00
u_cpu_detect.h util: move u_cpu_detect to util 2018-10-30 14:32:52 -07:00
u_debug.c util: Move u_debug to utils 2018-10-30 14:32:52 -07:00
u_debug.h util: Move u_debug to utils 2018-10-30 14:32:52 -07:00
u_drm.h util: Add a drm_find_modifier helper 2019-03-14 22:41:08 +00:00
u_dynarray.h u_dynarray: turn util_dynarray_{grow, resize} into element-oriented macros 2019-06-12 18:30:25 -04:00
u_endian.h
u_math.c util: fix a warning when building against clang7 headers 2019-02-27 08:57:41 +02:00
u_math.h u_math: add ushort_to_float/float_to_ushort 2019-04-11 09:57:53 +08:00
u_memory.h util: promote u_memory to src/util 2018-11-27 15:44:02 -05:00
u_process.c util/process: document memory leak 2019-04-04 16:09:52 +00:00
u_process.h
u_queue.c util/queue: add util_queue_adjust_num_threads 2019-04-01 12:37:52 -04:00
u_queue.h util/queue: add util_queue_adjust_num_threads 2019-04-01 12:37:52 -04:00
u_string.h
u_thread.h util: Don't block SIGSYS for new threads 2019-02-26 19:39:14 +01:00
u_vector.c
u_vector.h util: no-op __builtin_types_compatible_p() for non-GCC compilers 2019-03-29 15:33:43 -06:00
vma.c
vma.h
xmlconfig.c util: #define PATH_MAX when undefined (eg. Hurd) 2019-03-05 12:27:35 +00:00
xmlconfig.h
xmlpool.h driinfo: add DTD to allow the xml to be validated 2019-02-26 12:48:28 +00:00