From 1c9d853f39b3e5bcf2d830402a76de6c2db9bdd2 Mon Sep 17 00:00:00 2001 From: Daan Date: Mon, 10 Jan 2022 12:00:24 -0800 Subject: [PATCH 1/3] nicefy --- src/alloc-override-osx.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/alloc-override-osx.c b/src/alloc-override-osx.c index af79d64a..7e5c4e3e 100644 --- a/src/alloc-override-osx.c +++ b/src/alloc-override-osx.c @@ -192,8 +192,7 @@ static malloc_introspection_t mi_introspect = { .log = &intro_log, .force_lock = &intro_force_lock, .force_unlock = &intro_force_unlock, -#if defined(MAC_OS_X_VERSION_10_6) && \ - MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_6 +#if defined(MAC_OS_X_VERSION_10_6) && (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_6) .statistics = &intro_statistics, .zone_locked = &intro_zone_locked, #endif @@ -214,7 +213,7 @@ static malloc_zone_t mi_malloc_zone = { .batch_malloc = &zone_batch_malloc, .batch_free = &zone_batch_free, .introspect = &mi_introspect, -#if defined(MAC_OS_X_VERSION_10_6) && MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_6 +#if defined(MAC_OS_X_VERSION_10_6) && (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_6) #if defined(MAC_OS_X_VERSION_10_7) && (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_7) .version = 10, #else @@ -421,8 +420,7 @@ __attribute__((constructor)) // seems not supported by g++-11 on the M1 static void _mi_macos_override_malloc() { malloc_zone_t* purgeable_zone = NULL; - #if defined(MAC_OS_X_VERSION_10_6) && \ - MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_6 + #if defined(MAC_OS_X_VERSION_10_6) && (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_6) // force the purgeable zone to exist to avoid strange bugs if (malloc_default_purgeable_zone) { purgeable_zone = malloc_default_purgeable_zone(); From 4fc63358a60b421c1d907f59cf19622661e14472 Mon Sep 17 00:00:00 2001 From: Daan Date: Mon, 10 Jan 2022 12:01:26 -0800 Subject: [PATCH 2/3] update copyright year --- include/mimalloc-internal.h | 2 +- include/mimalloc.h | 2 +- src/alloc-override-osx.c | 2 +- src/alloc.c | 2 +- src/init.c | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/include/mimalloc-internal.h b/include/mimalloc-internal.h index 3da9a0c8..b90595ba 100644 --- a/include/mimalloc-internal.h +++ b/include/mimalloc-internal.h @@ -1,5 +1,5 @@ /* ---------------------------------------------------------------------------- -Copyright (c) 2018-2021, Microsoft Research, Daan Leijen +Copyright (c) 2018-2022, Microsoft Research, Daan Leijen This is free software; you can redistribute it and/or modify it under the terms of the MIT license. A copy of the license can be found in the file "LICENSE" at the root of this distribution. diff --git a/include/mimalloc.h b/include/mimalloc.h index e7cbec11..6f950751 100644 --- a/include/mimalloc.h +++ b/include/mimalloc.h @@ -1,5 +1,5 @@ /* ---------------------------------------------------------------------------- -Copyright (c) 2018-2021, Microsoft Research, Daan Leijen +Copyright (c) 2018-2022, Microsoft Research, Daan Leijen This is free software; you can redistribute it and/or modify it under the terms of the MIT license. A copy of the license can be found in the file "LICENSE" at the root of this distribution. diff --git a/src/alloc-override-osx.c b/src/alloc-override-osx.c index 7e5c4e3e..b53032e2 100644 --- a/src/alloc-override-osx.c +++ b/src/alloc-override-osx.c @@ -1,5 +1,5 @@ /* ---------------------------------------------------------------------------- -Copyright (c) 2018-2020, Microsoft Research, Daan Leijen +Copyright (c) 2018-2022, Microsoft Research, Daan Leijen This is free software; you can redistribute it and/or modify it under the terms of the MIT license. A copy of the license can be found in the file "LICENSE" at the root of this distribution. diff --git a/src/alloc.c b/src/alloc.c index ca32caba..53dd5963 100644 --- a/src/alloc.c +++ b/src/alloc.c @@ -1,5 +1,5 @@ /* ---------------------------------------------------------------------------- -Copyright (c) 2018-2021, Microsoft Research, Daan Leijen +Copyright (c) 2018-2022, Microsoft Research, Daan Leijen This is free software; you can redistribute it and/or modify it under the terms of the MIT license. A copy of the license can be found in the file "LICENSE" at the root of this distribution. diff --git a/src/init.c b/src/init.c index e06fa6b9..39a0d6fe 100644 --- a/src/init.c +++ b/src/init.c @@ -1,5 +1,5 @@ /* ---------------------------------------------------------------------------- -Copyright (c) 2018-2021, Microsoft Research, Daan Leijen +Copyright (c) 2018-2022, Microsoft Research, Daan Leijen This is free software; you can redistribute it and/or modify it under the terms of the MIT license. A copy of the license can be found in the file "LICENSE" at the root of this distribution. From 397f44c9573d762364e6fe77d5dae16c2003489b Mon Sep 17 00:00:00 2001 From: Daan Date: Mon, 10 Jan 2022 12:04:24 -0800 Subject: [PATCH 3/3] nicefy --- src/alloc-override-osx.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/alloc-override-osx.c b/src/alloc-override-osx.c index b53032e2..edd93b37 100644 --- a/src/alloc-override-osx.c +++ b/src/alloc-override-osx.c @@ -32,8 +32,7 @@ terms of the MIT license. A copy of the license can be found in the file extern "C" { #endif -#if defined(MAC_OS_X_VERSION_10_6) && \ - MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_6 +#if defined(MAC_OS_X_VERSION_10_6) && (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_6) // only available from OSX 10.6 extern malloc_zone_t* malloc_default_purgeable_zone(void) __attribute__((weak_import)); #endif