Commit Graph

60 Commits (0129d8e470e74ea60488321c13d95e0e020ad077)

Author SHA1 Message Date
Daniel Micay 58b56f10ea avoid -shared-libgcc due to old Clang versions 2019-08-18 04:53:51 -04:00
Daniel Micay abece7656b add enabled-by-default option to use -Werror 2019-08-18 02:28:23 -04:00
Daniel Micay c70745ab15 Makefile: add check target depending on tidy 2019-08-18 02:20:06 -04:00
Daniel Micay 8133444f43 move clang-tidy configuration to .clang-tidy 2019-08-18 02:12:18 -04:00
Daniel Micay 8f9f2521a0 disable sanitizer recovery in UBSan debug builds
This makes it harder to miss that an error occurred and avoids spamming
output. There should never be a single error, so it doesn't make sense
to gather as many errors as possible when a single error is already a
serious issue that would need to be fixed.
2019-08-18 02:00:13 -04:00
Daniel Micay d8ebdea05f handle CONFIG_SEAL_METADATA option like the others 2019-08-18 01:56:20 -04:00
Daniel Micay 8d2df1deb8 use CC as CXX to make sure LTO is compatible 2019-08-18 01:28:59 -04:00
Daniel Micay 1bc201c4c1 use -Wcast-align if -Wcast-align=strict is missing 2019-08-18 01:15:54 -04:00
Daniel Micay cc8c4459e1 make safe_flag treat unknown warnings as missing 2019-08-18 01:15:54 -04:00
Patrick Schleizer 75e86914aa respect existing CFLAGS, CPPFLAGS and LDFLAGS 2019-07-29 13:52:55 -04:00
Daniel Micay 90d12fb340 override local default to -fstack-protector-strong
This is a no-op on a toolchain compiled with the basic mitigations
enabled by default, so this is generally a no-op anywhere this project
is likely to be deployed. SSP has a very low performance cost so there's
little reason to avoid it, even though it also has zero value for this
code in practice. It would be great if one of the more modern approaches
was widely adopted, but unfortunately SSP is as good as it gets for
portable options. It doesn't provide any protection against external
writes to the stack data which is all that's really needed here.

ShadowCallStack is a great option for arm64, but it's substantially more
difficult to protect return addresses well on x86_64 due to the design of
the ISA and ABI.
2019-07-19 11:53:55 -04:00
Daniel Micay 77743e5a36 use -fstack-clash-protection for completeness
This is a no-op for the current code and will likely remain that way so
there's no benefit but also no performance cost.
2019-07-19 11:18:49 -04:00
Daniel Micay bb65d088dc drop default class region size to 32GiB 2019-06-19 01:00:22 -04:00
Daniel Micay 5449f4a94e use safe_flag for -fno-plt
This isn't supported by the ancient Clang release in Debian Stable.
2019-06-06 07:33:39 -04:00
Daniel Micay 6c31f6710a support extended range of small size classes 2019-04-10 08:31:51 -04:00
Daniel Micay 1b34fd4a69 enable 4 arenas by default 2019-04-10 08:12:59 -04:00
Daniel Micay cef7368b3c disable unusable readability-magic-numbers lint
This wouldn't be worth using even if it had a whole bunch of heuristics
like ignoring expressions in static_assert, ignoring repeated patterns
like assigning different things to sequential array indexes, etc.
2019-04-09 00:58:06 -04:00
Daniel Micay 295bfbde94 disable bugprone-too-small-loop-variable lint
This has too many false positives since it doesn't permit comparisons
against constants where the compiler can verify it doesn't overflow.
2019-04-09 00:55:16 -04:00
Daniel Micay ef90f404a6 add sanity check for stats option 2019-04-07 09:06:03 -04:00
Daniel Micay e0891c8cfc implement the option of large size classes
This extends the size class scheme used for slab allocations to large
allocations. This drastically improves performance for many real world
programs using incremental realloc growth instead of using proper growth
factors. There are 4 size classes for every doubling in size, resulting
in a worst case of ~20% extra virtual memory being reserved and a huge
increase in performance for pathological cases. For example, growing
from 4MiB to 8MiB by calling realloc in increments of 32 bytes will only
need to do work beyond looking up the size 4 times instead of 1024 times
with 4096 byte granularity.
2019-04-07 08:52:17 -04:00
Daniel Micay 350d0e5fd2 add real mallinfo implementation for Android
Android Q uses the mallinfo implementation in the ART GC:

c220f98180
1575267302
2019-04-06 20:54:26 -04:00
Daniel Micay c5e911419d add initial implementation of arenas 2019-03-25 14:59:50 -04:00
Daniel Micay c8b948e202 enable C++17 support when available 2019-03-23 19:46:54 -04:00
Daniel Micay 8a474b647c enable both forms of slab quarantines by default 2019-01-02 14:59:19 -05:00
Daniel Micay ccc2a86501 rename quarantine size -> length for clarity 2019-01-02 14:17:02 -05:00
Daniel Micay 2d88b90282 reorder Makefile CONFIG variables 2018-12-09 11:03:12 -05:00
Daniel Micay 830a7d338d make class_region_size configurable 2018-12-05 09:38:13 -05:00
Daniel Micay 79cf5cbeb4 disambiguate malloc.h 2018-12-05 07:59:35 -05:00
Daniel Micay 9fd0670aac add lib prefix to the shared object name 2018-12-05 02:05:37 -05:00
Daniel Micay f3623e1f2b finish migration away from config.h 2018-11-16 15:40:45 -05:00
Daniel Micay 06149aa156 enable readability-else-after-return tidy check 2018-11-16 15:12:10 -05:00
Daniel Micay a8112fc5c3 use -O3 instead of -O2 primarily for more inlining 2018-11-04 19:45:04 -05:00
Daniel Micay 505b9d2e76 add missing -Wl,--as-needed (removed by mistake) 2018-11-04 14:32:03 -05:00
Daniel Micay 1da51ddde1 migrate bool configuration options out of config.h 2018-11-02 21:35:09 -04:00
Daniel Micay 5bee717134 use -march=native by default with a disable toggle 2018-10-28 22:49:15 -04:00
Daniel Micay 9d1567ce16 make safe_flag check compatible with POSIX sh 2018-10-23 15:55:45 -04:00
Daniel Micay 05ac717cf2 work around -Wcast-align=strict error with old GCC 2018-10-23 07:23:07 -04:00
Daniel Micay 0b963078d5 guard metadata with Memory Protection Keys (MPK) 2018-10-23 01:11:31 -04:00
Daniel Micay ac8c68de53 enable pointer cast warnings 2018-10-21 15:50:26 -04:00
Daniel Micay 173ed53539 use consistent code style in chacha.c 2018-10-19 17:09:41 -04:00
Daniel Micay d728afae8e add configuration option for testing with UBSan 2018-10-14 18:58:54 -04:00
Daniel Micay 3c0a448c3e enable more tidy checks 2018-10-14 18:33:40 -04:00
Daniel Micay 118549451b add tidy target to the Makefile for clang-tidy 2018-10-14 18:05:08 -04:00
Daniel Micay fa2796a941 Makefile: add missing dependencies 2018-10-07 11:31:07 -04:00
Daniel Micay 3a936295f8 Makefile: split out shared compiler flags 2018-10-05 02:45:40 -04:00
Daniel Micay e6e9ac1fc9 support replacing C++ new/delete implementation
This adds support for sanity checks based on sized deallocation and will
reduce the overhead of calls through the C++ allocator.
2018-10-05 02:11:29 -04:00
Daniel Micay ef32a4b7ea add -pipe to CFLAGS 2018-10-04 04:03:48 -04:00
Daniel Micay 49af83a817 wrap mutex type to enable future optimization 2018-09-07 01:13:08 -04:00
Daniel Micay d398384b90 add header for configuration 2018-09-07 00:17:31 -04:00
Daniel Micay 7e088dc870 add stubs for Android extensions 2018-09-02 05:08:45 -04:00