Skip to content

Commit 5f84e2b

Browse files
authored
Merge pull request #59 from struct/improve_thread_caches_12_2021
add new thread caching improvements
2 parents 2a62f9c + fa3d924 commit 5f84e2b

12 files changed

Lines changed: 247 additions & 106 deletions

Makefile

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -139,14 +139,17 @@ ABORT_ON_NULL = -DABORT_ON_NULL=0
139139
## Enable protection against misusing 0 sized allocations
140140
NO_ZERO_ALLOCATIONS = -DNO_ZERO_ALLOCATIONS=1
141141

142+
LIBNAME = libisoalloc.so
143+
142144
UNAME := $(shell uname)
143145
ifeq ($(UNAME), Darwin)
144146
OS_FLAGS = -framework Security
145147
CPU_PIN = ""
148+
LIBNAME = libisoalloc.dylib
146149
endif
147150

148151
ifeq ($(UNAME), Linux)
149-
STRIP = strip -s $(BUILD_DIR)/libisoalloc.so
152+
STRIP = strip -s $(BUILD_DIR)/$(LIBNAME)
150153
endif
151154

152155
HOOKS = $(MALLOC_HOOK)
@@ -179,30 +182,30 @@ all: library tests
179182
## Build a release version of the library
180183
library: clean
181184
@echo "make library"
182-
$(CC) $(CFLAGS) $(LIBRARY) $(OPTIMIZE) $(OS_FLAGS) $(C_SRCS) -o $(BUILD_DIR)/libisoalloc.so
185+
$(CC) $(CFLAGS) $(LIBRARY) $(OPTIMIZE) $(OS_FLAGS) $(C_SRCS) -o $(BUILD_DIR)/$(LIBNAME)
183186
$(STRIP)
184187

185188
## Build a debug version of the library
186189
library_debug: clean
187190
@echo "make library debug"
188-
$(CC) $(CFLAGS) $(LIBRARY) $(OS_FLAGS) $(DEBUG_LOG_FLAGS) $(GDB_FLAGS) $(C_SRCS) -o $(BUILD_DIR)/libisoalloc.so
191+
$(CC) $(CFLAGS) $(LIBRARY) $(OS_FLAGS) $(DEBUG_LOG_FLAGS) $(GDB_FLAGS) $(C_SRCS) -o $(BUILD_DIR)/$(LIBNAME)
189192

190193
## Build a debug version of the library
191194
## specifically for unit tests
192195
library_debug_unit_tests: clean
193196
@echo "make library_debug_unit_tests"
194-
$(CC) $(CFLAGS) $(LIBRARY) $(OS_FLAGS) $(UNIT_TESTING) $(DEBUG_LOG_FLAGS) $(GDB_FLAGS) $(C_SRCS) -o $(BUILD_DIR)/libisoalloc.so
197+
$(CC) $(CFLAGS) $(LIBRARY) $(OS_FLAGS) $(UNIT_TESTING) $(DEBUG_LOG_FLAGS) $(GDB_FLAGS) $(C_SRCS) -o $(BUILD_DIR)/$(LIBNAME)
195198

196199
## Builds a debug version of the library with scan-build
197200
## Requires scan-build is in your PATH
198201
analyze_library_debug: clean
199202
@echo "make analyze_library_debug"
200-
scan-build $(CC) $(CFLAGS) $(LIBRARY) $(OS_FLAGS) $(DEBUG_LOG_FLAGS) $(GDB_FLAGS) $(C_SRCS) -o $(BUILD_DIR)/libisoalloc.so
203+
scan-build $(CC) $(CFLAGS) $(LIBRARY) $(OS_FLAGS) $(DEBUG_LOG_FLAGS) $(GDB_FLAGS) $(C_SRCS) -o $(BUILD_DIR)/$(LIBNAME)
201204

202205
## Build a debug version of the library
203206
library_debug_no_output: clean
204207
@echo "make library_debug_no_output"
205-
$(CC) $(CFLAGS) $(LIBRARY) $(OS_FLAGS) $(GDB_FLAGS) $(C_SRCS) -o $(BUILD_DIR)/libisoalloc.so
208+
$(CC) $(CFLAGS) $(LIBRARY) $(OS_FLAGS) $(GDB_FLAGS) $(C_SRCS) -o $(BUILD_DIR)/$(LIBNAME)
206209

207210
## C++ Support - Build object files for C code
208211
c_library_objects:
@@ -219,12 +222,12 @@ c_library_objects_debug:
219222
## C++ Support - Build the library with C++ support
220223
cpp_library: clean c_library_objects
221224
@echo "make cpp_library"
222-
$(CXX) $(CXXFLAGS) $(OPTIMIZE) $(LIBRARY) $(OS_FLAGS) $(CXX_SRCS) $(BUILD_DIR)/*.o -o $(BUILD_DIR)/libisoalloc.so
225+
$(CXX) $(CXXFLAGS) $(OPTIMIZE) $(LIBRARY) $(OS_FLAGS) $(CXX_SRCS) $(BUILD_DIR)/*.o -o $(BUILD_DIR)/$(LIBNAME)
223226
$(STRIP)
224227

225228
cpp_library_debug: clean c_library_objects_debug
226229
@echo "make cpp_library_debug"
227-
$(CXX) $(CXXFLAGS) $(DEBUG_LOG_FLAGS) $(GDB_FLAGS) $(LIBRARY) $(OS_FLAGS) $(CXX_SRCS) $(BUILD_DIR)/*.o -o $(BUILD_DIR)/libisoalloc.so
230+
$(CXX) $(CXXFLAGS) $(DEBUG_LOG_FLAGS) $(GDB_FLAGS) $(LIBRARY) $(OS_FLAGS) $(CXX_SRCS) $(BUILD_DIR)/*.o -o $(BUILD_DIR)/$(LIBNAME)
228231

229232
## Build a debug version of the unit test
230233
tests: clean library_debug_unit_tests
@@ -279,10 +282,10 @@ malloc_cmp_test: clean
279282
cpp_tests: clean cpp_library_debug
280283
@echo "make cpp_tests"
281284
$(CXX) $(CXXFLAGS) $(DEBUG_LOG_FLAGS) $(EXE_CFLAGS) tests/tests.cpp $(ISO_ALLOC_PRINTF_SRC) -o $(BUILD_DIR)/cxx_tests $(LDFLAGS)
282-
LD_LIBRARY_PATH=$(BUILD_DIR)/ LD_PRELOAD=$(BUILD_DIR)/libisoalloc.so $(BUILD_DIR)/cxx_tests
285+
LD_LIBRARY_PATH=$(BUILD_DIR)/ LD_PRELOAD=$(BUILD_DIR)/$(LIBNAME) $(BUILD_DIR)/cxx_tests
283286

284287
install:
285-
cp -pR build/libisoalloc.so /usr/lib/
288+
cp -pR build/$(LIBNAME) /usr/lib/
286289

287290
format:
288291
clang-format $(SRC_DIR)/*.* tests/*.* include/*.h -i

PERFORMANCE.md

Lines changed: 125 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -34,44 +34,56 @@ I've spent a good amount of time testing IsoAlloc to ensure its reasonably fast
3434

3535
The `malloc_cmp_test` build target will build 2 different versions of the test/tests.c program which runs roughly 1.4 million alloc/calloc/realloc operations. We free every other allocation and then free the remaining ones once the allocation loop is complete. This helps simulate some fragmentation in the heap. On average IsoAlloc is faster than ptmalloc but the difference is so close it will likely not be noticable.
3636

37-
The following test was run in an Ubuntu 20.04 for ARM64 docker container with libc version 2.31-0ubuntu9.2 on a MacOS host. The kernel used was `Linux 8772e39a0c20 5.10.25-linuxkit`.
37+
The following test was run in an Ubuntu 20.04.3 LTS (Focal Fossa) for ARM64 docker container with libc version 2.31-0ubuntu9.2 on a MacOS host. The kernel used was `Linux f7f23ca7dc44 5.10.76-linuxkit`.
3838

3939
```
4040
Running IsoAlloc Performance Test
4141
42-
iso_alloc/iso_free 1441616 tests completed in 0.146020 seconds
43-
iso_calloc/iso_free 1441616 tests completed in 0.174673 seconds
44-
iso_realloc/iso_free 1441616 tests completed in 0.249192 seconds
42+
build/tests
43+
iso_alloc/iso_free 1441616 tests completed in 0.168293 seconds
44+
iso_calloc/iso_free 1441616 tests completed in 0.171274 seconds
45+
iso_realloc/iso_free 1441616 tests completed in 0.231350 seconds
4546
4647
Running glibc/ptmalloc Performance Test
4748
48-
malloc/free 1441616 tests completed in 0.171125 seconds
49-
calloc/free 1441616 tests completed in 0.228953 seconds
50-
realloc/free 1441616 tests completed in 0.317215 seconds
49+
malloc/free 1441616 tests completed in 0.166813 seconds
50+
calloc/free 1441616 tests completed in 0.223232 seconds
51+
realloc/free 1441616 tests completed in 0.306684 seconds
5152
5253
Running jemalloc Performance Test
5354
54-
malloc/free 1441616 tests completed in 0.059686 seconds
55-
calloc/free 1441616 tests completed in 0.188510 seconds
56-
realloc/free 1441616 tests completed in 0.190125 seconds
55+
LD_PRELOAD=/code/mimalloc-bench/extern/jemalloc/lib/libjemalloc.so build/malloc_tests
56+
malloc/free 1441616 tests completed in 0.064520 seconds
57+
calloc/free 1441616 tests completed in 0.178228 seconds
58+
realloc/free 1441616 tests completed in 0.271620 seconds
5759
5860
Running mimalloc Performance Test
5961
60-
malloc/free 1441616 tests completed in 0.091053 seconds
61-
calloc/free 1441616 tests completed in 0.118271 seconds
62-
realloc/free 1441616 tests completed in 0.154681 seconds
62+
LD_PRELOAD=/code/mimalloc-bench/extern/mimalloc/out/release/libmimalloc.so build/malloc_tests
63+
malloc/free 1441616 tests completed in 0.085471 seconds
64+
calloc/free 1441616 tests completed in 0.099644 seconds
65+
realloc/free 1441616 tests completed in 0.143821 seconds
6366
6467
Running mimalloc-secure Performance Test
6568
66-
malloc/free 1441616 tests completed in 0.136460 seconds
67-
calloc/free 1441616 tests completed in 0.163846 seconds
68-
realloc/free 1441616 tests completed in 0.193132 seconds
69+
LD_PRELOAD=/code/mimalloc-bench/extern/mimalloc/out/secure/libmimalloc-secure.so build/malloc_tests
70+
malloc/free 1441616 tests completed in 0.128479 seconds
71+
calloc/free 1441616 tests completed in 0.148797 seconds
72+
realloc/free 1441616 tests completed in 0.191719 seconds
6973
7074
Running tcmalloc Performance Test
7175
72-
malloc/free 1441616 tests completed in 0.108659 seconds
73-
calloc/free 1441616 tests completed in 0.124787 seconds
74-
realloc/free 1441616 tests completed in 0.141458 seconds
76+
LD_PRELOAD=/code/mimalloc-bench/extern/gperftools/.libs/libtcmalloc_minimal.so build/malloc_tests
77+
malloc/free 1441616 tests completed in 0.093779 seconds
78+
calloc/free 1441616 tests completed in 0.103634 seconds
79+
realloc/free 1441616 tests completed in 0.131152 seconds
80+
81+
Running scudo Performance Test
82+
83+
LD_PRELOAD=/code/mimalloc-bench/extern/scudo/compiler-rt/lib/scudo/standalone/libscudo.so build/malloc_tests
84+
malloc/free 1441616 tests completed in 0.227757 seconds
85+
calloc/free 1441616 tests completed in 0.204610 seconds
86+
realloc/free 1441616 tests completed in 0.258962 seconds
7587
7688
```
7789

@@ -91,20 +103,22 @@ calloc/free 1441616 tests completed in 0.246065 seconds
91103
realloc/free 1441616 tests completed in 0.332292 seconds
92104
```
93105

94-
Here is the same test as above on Mac OS 11.6
106+
Here is the same test as above on Mac OS 12.1
95107

96108
```
97109
Running IsoAlloc Performance Test
98110
99-
iso_alloc/iso_free 1441616 tests completed in 0.124150 seconds
100-
iso_calloc/iso_free 1441616 tests completed in 0.182955 seconds
101-
iso_realloc/iso_free 1441616 tests completed in 0.275084 seconds
111+
build/tests
112+
iso_alloc/iso_free 1441616 tests completed in 0.149818 seconds
113+
iso_calloc/iso_free 1441616 tests completed in 0.183772 seconds
114+
iso_realloc/iso_free 1441616 tests completed in 0.274413 seconds
102115
103116
Running system malloc Performance Test
104117
105-
malloc/free 1441616 tests completed in 0.090845 seconds
106-
calloc/free 1441616 tests completed in 0.200397 seconds
107-
realloc/free 1441616 tests completed in 0.254574 seconds
118+
build/malloc_tests
119+
malloc/free 1441616 tests completed in 0.084803 seconds
120+
calloc/free 1441616 tests completed in 0.194901 seconds
121+
realloc/free 1441616 tests completed in 0.240934 seconds
108122
```
109123

110124
This same test can be used with the `perf` utility to measure basic stats like page faults and CPU utilization using both heap implementations. The output below is on the same AWS t2.xlarge instance as above.
@@ -153,35 +167,90 @@ The following benchmarks were collected from [mimalloc-bench](https://github.com
153167
```
154168
# benchmark allocator elapsed rss user sys page-faults page-reclaims
155169
156-
barnes isoalloc 02.00 65476 1.97 0.02 3 18495
157-
barnes mimalloc 01.95 57836 1.93 0.01 0 16552
158-
barnes tcmalloc 01.95 62612 1.93 0.01 0 17516
159-
barnes jemalloc 01.94 59480 1.92 0.01 0 16649
160-
161-
cache-scratch1 isoalloc 01.28 10736 1.27 0.00 1 2158
162-
cache-scratch1 mimalloc 01.27 3180 1.27 0.00 0 200
163-
cache-scratch1 tcmalloc 01.27 6876 1.27 0.00 0 1129
164-
cache-scratch1 jemalloc 01.27 3460 1.27 0.00 0 236
165-
166-
cache-scratchN isoalloc 00.37 11136 1.45 0.00 0 2265
167-
cache-scratchN mimalloc 00.36 3468 1.44 0.00 0 230
168-
cache-scratchN tcmalloc 01.87 6976 7.44 0.00 0 1142
169-
cache-scratchN jemalloc 01.86 3748 7.41 0.00 0 283
170-
171-
cache-thrash1 isoalloc 01.34 10856 1.31 0.01 1 2162
172-
cache-thrash1 mimalloc 01.27 3380 1.27 0.00 0 206
173-
cache-thrash1 tcmalloc 01.27 6868 1.26 0.00 0 1127
174-
cache-thrash1 jemalloc 01.27 3648 1.27 0.00 0 240
175-
176-
cache-thrashN isoalloc 01.00 10784 3.82 0.00 0 2174
177-
cache-thrashN mimalloc 00.36 3356 1.44 0.00 0 229
178-
cache-thrashN tcmalloc 01.87 6880 7.42 0.00 0 1138
179-
cache-thrashN jemalloc 00.37 3760 1.46 0.00 0 296
180-
181-
redis isoalloc 8.669 76240 4.07 0.30 1 21473 ops/sec: 230702.66, relative time: 8.669s
182-
redis mimalloc 4.555 28968 2.13 0.17 4 6655 ops/sec: 439023.69, relative time: 4.555s
183-
redis tcmalloc 4.715 37120 2.21 0.17 3 8446 ops/sec: 424108.56, relative time: 4.715s
184-
redis jemalloc 5.125 30836 2.41 0.17 0 7034 ops/sec: 390174.03, relative time: 5.125s
170+
cfrac jemalloc 03.47 3948 3.46 0.00 0 422
171+
cfrac mimalloc 03.19 2688 3.18 0.00 0 337
172+
cfrac smimalloc 03.57 2860 3.56 0.00 0 375
173+
cfrac tcmalloc 03.25 7392 3.24 0.00 0 1325
174+
cfrac scudo 06.00 3920 5.99 0.00 0 561
175+
cfrac isoalloc 05.69 12920 5.58 0.10 0 3016
176+
177+
espresso jemalloc 03.61 4508 3.56 0.00 5 553
178+
espresso mimalloc 03.43 3828 3.40 0.01 1 1299
179+
espresso smimalloc 03.65 5760 3.60 0.01 0 2682
180+
espresso tcmalloc 03.43 8132 3.39 0.01 0 1485
181+
espresso scudo 04.53 4028 4.49 0.01 0 514
182+
espresso isoalloc 04.69 55060 4.60 0.06 0 13756
183+
184+
barnes jemalloc 01.93 59412 1.91 0.01 3 16646
185+
barnes mimalloc 01.91 57860 1.89 0.01 0 16539
186+
barnes smimalloc 01.98 57928 1.96 0.01 0 16557
187+
barnes tcmalloc 01.91 62664 1.89 0.01 0 17515
188+
barnes scudo 01.92 58940 1.91 0.01 0 16595
189+
barnes isoalloc 01.94 65600 1.92 0.01 0 18526
190+
191+
redis jemalloc 5.019 31280 2.37 0.17 0 7268
192+
redis mimalloc 4.487 29204 2.07 0.20 0 6825
193+
redis smimalloc 4.909 30992 2.28 0.20 0 7410
194+
redis tcmalloc 4.675 37336 2.17 0.20 0 8682
195+
redis scudo 6.105 36968 2.85 0.23 0 8623
196+
redis isoalloc 9.143 83576 4.23 0.39 0 26815
197+
198+
cache-thrash1 jemalloc 01.28 3648 1.27 0.00 1 240
199+
cache-thrash1 mimalloc 01.28 3408 1.28 0.00 0 197
200+
cache-thrash1 smimalloc 01.28 3256 1.27 0.00 0 202
201+
cache-thrash1 tcmalloc 01.27 7100 1.26 0.00 0 1127
202+
cache-thrash1 scudo 01.27 3240 1.26 0.00 0 200
203+
cache-thrash1 isoalloc 01.31 10716 1.29 0.00 0 2151
204+
205+
cache-thrashN jemalloc 00.21 3936 1.64 0.00 0 360
206+
cache-thrashN mimalloc 00.21 3516 1.63 0.00 0 239
207+
cache-thrashN smimalloc 00.22 3584 1.68 0.01 0 249
208+
cache-thrashN tcmalloc 02.74 6992 20.36 0.00 0 1151
209+
cache-thrashN scudo 00.61 3164 2.53 0.00 0 237
210+
cache-thrashN isoalloc 01.09 10896 8.56 0.01 0 2201
211+
212+
larsonN jemalloc 4.892 84172 39.71 0.20 1 52478
213+
larsonN mimalloc 4.360 98504 39.61 0.17 0 26372
214+
larsonN smimalloc 6.546 105724 39.77 0.16 3 27432
215+
larsonN tcmalloc 4.450 63464 39.57 0.21 0 15299
216+
larsonN scudo 44.707 33104 28.92 4.80 0 7826
217+
larsonN isoalloc 375.349 70268 39.65 0.30 0 17220
218+
219+
larsonN-sized jemalloc 4.872 84428 39.56 0.22 1 52874
220+
larsonN-sized mimalloc 4.335 95388 39.82 0.13 0 25625
221+
larsonN-sized smimalloc 6.332 1q06372 39.71 0.17 0 27642
222+
larsonN-sized tcmalloc 4.230 64956 39.59 0.15 0 15669
223+
larsonN-sized scudo 44.601 32900 28.68 4.65 0 7793
224+
larsonN-sized isoalloc 363.176 70240 39.59 0.29 0 17222
225+
226+
mstressN jemalloc 00.92 139772 2.10 1.76 1 984466
227+
mstressN mimalloc 00.43 352132 1.56 0.15 0 88171
228+
mstressN smimalloc 00.62 352204 1.85 0.67 0 95538
229+
mstressN tcmalloc 00.51 147680 1.80 0.25 0 37111
230+
mstressN scudo 01.38 142068 3.23 1.63 0 616639
231+
mstressN isoalloc 06.26 284052 33.62 1.02 0 746837
232+
233+
xmalloc-testN jemalloc 2.307 64460 25.13 5.14 1 22975
234+
xmalloc-testN mimalloc 0.513 82212 36.03 1.05 0 26689
235+
xmalloc-testN smimalloc 0.857 73504 36.58 1.05 0 28285
236+
xmalloc-testN tcmalloc 6.055 40824 9.31 18.77 0 9642
237+
xmalloc-testN scudo 13.416 56708 10.06 14.30 0 16560
238+
xmalloc-testN isoalloc 36.672 17672 39.04 0.10 0 5364
239+
240+
glibc-simple jemalloc 01.96 2984 1.95 0.00 1 313
241+
glibc-simple mimalloc 01.50 1900 1.49 0.00 0 212
242+
glibc-simple smimalloc 01.77 2032 1.76 0.00 0 229
243+
glibc-simple tcmalloc 01.52 6880 1.52 0.00 0 1212
244+
glibc-simple scudo 04.58 2776 4.58 0.00 0 281
245+
glibc-simple isoalloc 04.45 14696 4.34 0.10 0 3530
246+
247+
glibc-thread jemalloc 6.772 4160 15.98 0.00 1 457
248+
glibc-thread mimalloc 3.759 3320 15.98 0.00 0 585
249+
glibc-thread smimalloc 9.012 17144 15.89 0.02 0 4018
250+
glibc-thread tcmalloc 10.434 8508 15.99 0.00 0 1580
251+
glibc-thread scudo 80.979 4076 15.90 0.01 0 582
252+
glibc-thread isoalloc 1178.003 44192 15.83 0.05 0 10880
253+
185254
```
186255

187-
IsoAlloc isn't quite ready for performance sensitive server workloads but it's more than fast enough for client side mobile/desktop applications with risky C/C++ attack surface.
256+
IsoAlloc isn't quite ready for performance sensitive server workloads. However it's more than fast enough for client side mobile/desktop applications with risky C/C++ attack surfaces. These environments have threat models similar to what IsoAlloc was designed for.

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -180,3 +180,5 @@ If all else fails please file an issue on the [github project](https://github.co
180180
`void iso_verify_zone(iso_alloc_zone_handle *zone)` - Verifies the state of specified zone. Will abort if inconsistencies are found.
181181

182182
`int32_t iso_alloc_name_zone(iso_alloc_zone_handle *zone, char *name)` - Allows naming of custom zones via prctl on Android
183+
184+
`void iso_flush_caches()` - Flushes all thread specific caches. Intended to be used upon thread destruction

include/iso_alloc.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ EXTERNAL_API uint64_t iso_alloc_mem_usage();
4444
EXTERNAL_API void iso_verify_zones();
4545
EXTERNAL_API void iso_verify_zone(iso_alloc_zone_handle *zone);
4646
EXTERNAL_API int32_t iso_alloc_name_zone(iso_alloc_zone_handle *zone, char *name);
47+
EXTERNAL_API void iso_flush_caches();
4748

4849
#if EXPERIMENTAL
4950
EXTERNAL_API void iso_alloc_search_stack(void *p);

include/iso_alloc_internal.h

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -320,6 +320,7 @@ using namespace std;
320320

321321
/* The size of the thread cache */
322322
#define THREAD_ZONE_CACHE_SZ 8
323+
#define THREAD_CHUNK_CACHE_SZ 4
323324

324325
#define MEGABYTE_SIZE 1048576
325326
#define KILOBYTE_SIZE 1024
@@ -450,6 +451,9 @@ typedef struct {
450451
iso_alloc_zone *zone;
451452
} __attribute__((aligned(sizeof(int64_t)))) _tzc;
452453

454+
/* Each thread also gets a local cache of usable chunks.
455+
* This cache is populated during both alloc and free
456+
* operations using the same zone */
453457
typedef struct {
454458
size_t chunk_size;
455459
void *chunk;
@@ -526,9 +530,9 @@ INTERNAL_HIDDEN INLINE void iso_clear_user_chunk(uint8_t *p, size_t size);
526530
INTERNAL_HIDDEN INLINE void fill_free_bit_slot_cache(iso_alloc_zone *zone);
527531
INTERNAL_HIDDEN INLINE void insert_free_bit_slot(iso_alloc_zone *zone, int64_t bit_slot);
528532
INTERNAL_HIDDEN INLINE void write_canary(iso_alloc_zone *zone, void *p);
529-
INTERNAL_HIDDEN INLINE void flush_thread_cache(void);
530533
INTERNAL_HIDDEN INLINE void populate_thread_caches(iso_alloc_zone *zone);
531534
INTERNAL_HIDDEN INLINE size_t next_pow2(size_t sz);
535+
INTERNAL_HIDDEN INLINE void _flush_thread_caches(void);
532536
INTERNAL_HIDDEN iso_alloc_zone *is_zone_usable(iso_alloc_zone *zone, size_t size);
533537
INTERNAL_HIDDEN iso_alloc_zone *iso_find_zone_fit(size_t size);
534538
INTERNAL_HIDDEN iso_alloc_zone *iso_new_zone(size_t size, bool internal);
@@ -540,6 +544,7 @@ INTERNAL_HIDDEN bit_slot_t iso_scan_zone_free_slot(iso_alloc_zone *zone);
540544
INTERNAL_HIDDEN bit_slot_t get_next_free_bit_slot(iso_alloc_zone *zone);
541545
INTERNAL_HIDDEN iso_alloc_root *iso_alloc_new_root(void);
542546
INTERNAL_HIDDEN bool iso_does_zone_fit(iso_alloc_zone *zone, size_t size);
547+
INTERNAL_HIDDEN void flush_thread_caches(void);
543548
INTERNAL_HIDDEN void iso_free_chunk_from_zone(iso_alloc_zone *zone, void *p, bool permanent);
544549
INTERNAL_HIDDEN void create_canary_chunks(iso_alloc_zone *zone);
545550
INTERNAL_HIDDEN void iso_alloc_initialize_global_root(void);

0 commit comments

Comments
 (0)