Loading...
--- libmalloc/libmalloc-317.40.8/src/nano_malloc_common.c
+++ libmalloc/libmalloc-166.200.60/src/nano_malloc_common.c
@@ -46,7 +46,7 @@
// The maximum number of per-CPU allocation regions to use for Nano.
unsigned int nano_common_max_magazines;
-boolean_t nano_common_max_magazines_is_ncpu = true;
+boolean_t nano_common_max_magazines_is_ncpu;
// Boot argument for nano_common_max_magazines
static const char nano_max_magazines_boot_arg[] = "malloc_nano_max_magazines";
@@ -162,11 +162,6 @@
// Environment variable overrides boot arg, unless it's not valid.
const char *flag = getenv("MallocNanoMaxMagazines");
-#if RDAR_48993662
- if (!flag) {
- flag = getenv("_MallocNanoMaxMagazines");
- }
-#endif // RDAR_48993662
if (flag) {
int value = (int)strtol(flag, NULL, 0);
if (value < 0) {
@@ -294,17 +289,11 @@
void
nano_common_cpu_number_override_set()
{
- boolean_t is_ncpu = _os_cpu_number_override == -1 && nano_common_max_magazines == phys_ncpus;
-
// This facilitates a shortcut in nanov2_get_allocation_block_index() --
// if nano_common_max_magazines_is_ncpu is true, we can also assume that
// _os_cpu_number_override == -1 (i.e. we are not in malloc_replay).
- //
- // We check here for false, because we don't want to write "true" to a __DATA page because
- // that would make it dirty: <rdar://problem/46994833>
- if (!is_ncpu) {
- nano_common_max_magazines_is_ncpu = is_ncpu;
- }
+ nano_common_max_magazines_is_ncpu = _os_cpu_number_override == -1 &&
+ nano_common_max_magazines == phys_ncpus;
}
#endif // CONFIG_NANOZONE