Fix some nits

This commit is contained in:
Justine Tunney 2024-06-05 04:05:08 -07:00
parent 3093f0e467
commit cc2c1893c5
No known key found for this signature in database
GPG key ID: BE714B4575D6E328
2 changed files with 4 additions and 8 deletions

View file

@ -44,7 +44,7 @@ $(LIBC_MEM_A_OBJS): private \
-Wframe-larger-than=4096 \
-Walloca-larger-than=4096
o/$(MODE)/libc/intrin/asan.o: private \
o/$(MODE)/libc/mem/asan.o: private \
CFLAGS += \
-O2 \
-finline \
@ -58,7 +58,7 @@ o/$(MODE)/libc/intrin/asan.o: private \
-fpatchable-function-entry=0,0
# make asan stack traces shorter
o/$(MODE)/libc/intrin/asanthunk.o: private \
o/$(MODE)/libc/mem/asanthunk.o: private \
CFLAGS += \
-Os \
$(NO_MAGIC) \

View file

@ -54,8 +54,7 @@ int dlmallopt(int param_number, int value) {
int dlmalloc_trim(size_t pad) {
int got_some = 0;
for (unsigned i = 0; i < g_heapslen; ++i)
if (g_heaps[i])
got_some |= mspace_trim(g_heaps[i], pad);
got_some |= mspace_trim(g_heaps[i], pad);
return got_some;
}
@ -69,8 +68,7 @@ void dlmalloc_inspect_all(void handler(void *start, void *end,
size_t used_bytes, void *callback_arg),
void *arg) {
for (unsigned i = 0; i < g_heapslen; ++i)
if (g_heaps[i])
mspace_inspect_all(g_heaps[i], handler, arg);
mspace_inspect_all(g_heaps[i], handler, arg);
}
forceinline mstate get_arena(void) {
@ -166,8 +164,6 @@ static void threaded_dlmalloc(void) {
cpus = __get_cpu_count();
if (cpus == -1)
heaps = 1;
else if (!IsAarch64() && !X86_HAVE(RDTSCP))
heaps = 1;
else if ((var = getenv("COSMOPOLITAN_HEAP_COUNT")))
heaps = dlmalloc_atoi(var);
else