Commit Graph

705 Commits

Author SHA1 Message Date
Daniel Micay
a875951e82 fix build with musl 2018-09-06 14:35:08 -04:00
Daniel Micay
e891b40588 implement Android malloc_disable/malloc_enable API 2018-09-06 14:17:23 -04:00
Daniel Micay
3a532b17dc implement in-place shrinking for large allocations 2018-09-05 07:37:26 -04:00
Daniel Micay
645209dcbf remove unnecessary debugging code 2018-09-05 03:42:05 -04:00
Daniel Micay
bf55fad6d0 document that slab canaries are implemented 2018-09-05 00:19:27 -04:00
Daniel Micay
9ddd53d56c implement initial slab allocation canaries 2018-09-04 09:29:35 -04:00
Daniel Micay
5017500a47 add simple overflow tests 2018-09-04 09:15:23 -04:00
Daniel Micay
1a7b8079d0 reuse is_init when possible 2018-09-02 19:58:57 -04:00
Daniel Micay
7733047c7b trigger early initialization in a conservative way 2018-09-02 19:52:12 -04:00
Daniel Micay
2ec65306dd expand documentation on supported environments 2018-09-02 06:05:37 -04:00
Daniel Micay
8bb686e697 add missing prefix defines 2018-09-02 05:24:25 -04:00
Daniel Micay
9c74a67068 malloc_get_state/malloc_set_state are obsolete too 2018-09-02 05:20:17 -04:00
Daniel Micay
7e088dc870 add stubs for Android extensions 2018-09-02 05:08:45 -04:00
Daniel Micay
2dd2471b4a enable more linker sanity checks 2018-09-02 02:30:24 -04:00
Daniel Micay
39e81bd486 using -lpthread for linking isn't necessary 2018-09-02 02:13:23 -04:00
Daniel Micay
89c624b755 mark page management error code paths as unlikely 2018-09-02 02:08:44 -04:00
Daniel Micay
e4648192c0 split out code for managing page spans 2018-09-02 02:03:39 -04:00
Daniel Micay
e93d039214 only use reserved memory for regions hash table 2018-09-01 10:23:06 -04:00
Daniel Micay
c3a4829d77 remove unnecessary special case from realloc 2018-09-01 02:42:33 -04:00
Daniel Micay
f441dfe2e3 align size class metadata to cacheline size 2018-08-31 23:10:26 -04:00
Daniel Micay
fad10ce943 use FIFO queue for free slabs 2018-08-31 22:55:49 -04:00
Daniel Micay
dba330fde7 expand documentation in the README 2018-08-30 11:12:43 -04:00
Daniel Micay
3f80895822 ignore pad argument to malloc_trim per glibc
The pad argument is only used by the main arena for sbrk in glibc, with
every other page size gap purged with MADV_DONTNEED. It makes more sense
to simply treat it as an ignored legacy parameter rather than trying to
come up with a sensible way to use it for keeping cached free slabs.
2018-08-30 09:36:46 -04:00
Daniel Micay
af393afc09 make preload script for testing a bit more robust 2018-08-30 09:08:33 -04:00
Daniel Micay
1ea997b887 add missing headers to malloc.h 2018-08-30 08:48:43 -04:00
Daniel Micay
2b0f7aa985 use a consistent name for size class integer index 2018-08-30 07:13:28 -04:00
Daniel Micay
0f5f2bf6c9 add basic initial heuristic for freeing slabs 2018-08-30 06:56:00 -04:00
Daniel Micay
456dfe4154 add support for purging and protecting empty slabs 2018-08-30 05:59:44 -04:00
Daniel Micay
bb176e09bc remove useless code in the empty_slabs path 2018-08-30 05:45:03 -04:00
Daniel Micay
29df2429c2 empty_slabs will remain a singly-linked list 2018-08-30 05:27:51 -04:00
Daniel Micay
f94068ea63 rename free_slabs to empty_slabs 2018-08-30 04:55:39 -04:00
Daniel Micay
b6d4af872f move libdivide.h to third_party/libdivide.h 2018-08-30 03:03:19 -04:00
Daniel Micay
99fcddc223 use much faster get_random_{type}_uniform approach 2018-08-30 02:08:05 -04:00
Daniel Micay
1c181557c7 add -fno-plt as an optimization 2018-08-29 15:20:56 -04:00
Daniel Micay
6f9de3e667 add inline hint to get_size_info 2018-08-29 15:13:53 -04:00
Daniel Micay
e85c69a0a4 fix builds with prefix 2018-08-29 15:07:36 -04:00
Daniel Micay
becadc57a5 get rid of unused MIN_ALIGN definition 2018-08-29 14:18:45 -04:00
Daniel Micay
2684a98eab add initial malloc_object_size extensions 2018-08-29 14:18:42 -04:00
Daniel Micay
00b2613e16 add mmap MAP_FIXED wrapper for dropping slabs 2018-08-29 13:04:52 -04:00
Daniel Micay
0e2f3d1015 sanity check page size at runtime 2018-08-29 11:00:18 -04:00
Daniel Micay
d779d41721 wrap more memory mapping implementation details 2018-08-29 10:57:42 -04:00
Daniel Micay
1cb28531a8 add wrapper for mremap with sanity check 2018-08-29 10:43:54 -04:00
Daniel Micay
5bc6820c24 rely on mmap rounding to page size when possible 2018-08-29 03:25:00 -04:00
Daniel Micay
58d929c0f0 split out low-level memory mapping wrappers 2018-08-29 00:53:38 -04:00
Daniel Micay
8b42e8c3d6 make sure errno is always set on failure 2018-08-28 22:49:11 -04:00
Daniel Micay
66aa98dbd9 sanity-check mmap errno on failure too 2018-08-28 22:41:18 -04:00
Daniel Micay
705b6a4f8d make non-out-of-memory mprotect errors fatal 2018-08-28 22:22:57 -04:00
Daniel Micay
19c46d16f1 check pthread_atfork return value 2018-08-28 21:31:20 -04:00
Daniel Micay
0e2bc8a1cf make sure RELRO is enabled on every toolchain 2018-08-28 11:44:23 -04:00
Daniel Micay
e72674e358 detect missing symbols when linking 2018-08-28 11:13:17 -04:00