mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-06-26 22:38:30 +00:00
Fix some nits
This commit is contained in:
parent
3093f0e467
commit
cc2c1893c5
2 changed files with 4 additions and 8 deletions
|
@ -44,7 +44,7 @@ $(LIBC_MEM_A_OBJS): private \
|
||||||
-Wframe-larger-than=4096 \
|
-Wframe-larger-than=4096 \
|
||||||
-Walloca-larger-than=4096
|
-Walloca-larger-than=4096
|
||||||
|
|
||||||
o/$(MODE)/libc/intrin/asan.o: private \
|
o/$(MODE)/libc/mem/asan.o: private \
|
||||||
CFLAGS += \
|
CFLAGS += \
|
||||||
-O2 \
|
-O2 \
|
||||||
-finline \
|
-finline \
|
||||||
|
@ -58,7 +58,7 @@ o/$(MODE)/libc/intrin/asan.o: private \
|
||||||
-fpatchable-function-entry=0,0
|
-fpatchable-function-entry=0,0
|
||||||
|
|
||||||
# make asan stack traces shorter
|
# make asan stack traces shorter
|
||||||
o/$(MODE)/libc/intrin/asanthunk.o: private \
|
o/$(MODE)/libc/mem/asanthunk.o: private \
|
||||||
CFLAGS += \
|
CFLAGS += \
|
||||||
-Os \
|
-Os \
|
||||||
$(NO_MAGIC) \
|
$(NO_MAGIC) \
|
||||||
|
|
8
third_party/dlmalloc/threaded.inc
vendored
8
third_party/dlmalloc/threaded.inc
vendored
|
@ -54,8 +54,7 @@ int dlmallopt(int param_number, int value) {
|
||||||
int dlmalloc_trim(size_t pad) {
|
int dlmalloc_trim(size_t pad) {
|
||||||
int got_some = 0;
|
int got_some = 0;
|
||||||
for (unsigned i = 0; i < g_heapslen; ++i)
|
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;
|
return got_some;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -69,8 +68,7 @@ void dlmalloc_inspect_all(void handler(void *start, void *end,
|
||||||
size_t used_bytes, void *callback_arg),
|
size_t used_bytes, void *callback_arg),
|
||||||
void *arg) {
|
void *arg) {
|
||||||
for (unsigned i = 0; i < g_heapslen; ++i)
|
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) {
|
forceinline mstate get_arena(void) {
|
||||||
|
@ -166,8 +164,6 @@ static void threaded_dlmalloc(void) {
|
||||||
cpus = __get_cpu_count();
|
cpus = __get_cpu_count();
|
||||||
if (cpus == -1)
|
if (cpus == -1)
|
||||||
heaps = 1;
|
heaps = 1;
|
||||||
else if (!IsAarch64() && !X86_HAVE(RDTSCP))
|
|
||||||
heaps = 1;
|
|
||||||
else if ((var = getenv("COSMOPOLITAN_HEAP_COUNT")))
|
else if ((var = getenv("COSMOPOLITAN_HEAP_COUNT")))
|
||||||
heaps = dlmalloc_atoi(var);
|
heaps = dlmalloc_atoi(var);
|
||||||
else
|
else
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue