diff options
author | Szabolcs Nagy <szabolcs.nagy@arm.com> | 2021-01-27 15:45:43 +0000 |
---|---|---|
committer | Szabolcs Nagy <szabolcs.nagy@arm.com> | 2021-03-26 11:03:06 +0000 |
commit | 42bac88a211a7fac9dd1bfe7d1e45e59ac50c24f (patch) | |
tree | 7ada38d2ac5b38b658b46d5b6038890fa2c83db0 /malloc/tst-malloc-usable-tunables.c | |
parent | 0c719cf42c982ce627179cde4fd583bcca6417bd (diff) | |
download | glibc-42bac88a211a7fac9dd1bfe7d1e45e59ac50c24f.zip glibc-42bac88a211a7fac9dd1bfe7d1e45e59ac50c24f.tar.gz glibc-42bac88a211a7fac9dd1bfe7d1e45e59ac50c24f.tar.bz2 |
malloc: Use global flag instead of function pointer dispatch for mtag
A flag check can be faster than function pointers because of how
branch prediction and speculation works and it can also remove a layer
of indirection when there is a mismatch between the malloc internal
tag_* api and __libc_mtag_* target hooks.
Memory tagging wrapper functions are moved to malloc.c from arena.c and
the logic now checks mmap_enabled. The definition of tag_new_usable is
moved after chunk related definitions.
This refactoring also allows using mtag_enabled checks instead of
USE_MTAG ifdefs when memory tagging support only changes code logic
when memory tagging is enabled at runtime. Note: an "if (false)" code
block is optimized away even at -O0 by gcc.
Reviewed-by: DJ Delorie <dj@redhat.com>
Diffstat (limited to 'malloc/tst-malloc-usable-tunables.c')
0 files changed, 0 insertions, 0 deletions