Loading...
gen/malloc.c Libc-825.25 Libc-763.11
--- Libc/Libc-825.25/gen/malloc.c
+++ Libc/Libc-763.11/gen/malloc.c
@@ -98,6 +98,7 @@
  * 3 - a new default zone has been created and another environment variable scan
  */
 __private_extern__ int malloc_def_zone_state = 0;
+__private_extern__ malloc_zone_t *__zone0 = NULL;
 
 static const char Malloc_Facility[] = "com.apple.Libsystem.malloc";
 
@@ -217,7 +218,7 @@
 
 __private_extern__ boolean_t __stack_logging_locked();
 
-__private_extern__ __attribute__((noinline)) __attribute__((used)) int
+__private_extern__ __attribute__((noinline)) int
 malloc_gdb_po_unsafe(void) {
   // In order to implement "po" other data formatters in gdb, the debugger
   // calls functions that call malloc.  The debugger will  only run one thread 
@@ -404,7 +405,7 @@
     malloc_debug_flags = SCALABLE_MALLOC_ABORT_ON_CORRUPTION; // Set always on 64-bit processes
 #else
     int libSystemVersion  = NSVersionOfLinkTimeLibrary("System");
-    if ((-1 != libSystemVersion) && ((libSystemVersion >> 16) < 126) /* Lion or greater */)
+    if ((-1 != libSystemVersion) && ((libSystemVersion >> 16) < 126) /* CFSystemVersionBarolo */)
 	malloc_debug_flags = 0;
     else
 	malloc_debug_flags = SCALABLE_MALLOC_ABORT_ON_CORRUPTION;
@@ -616,6 +617,25 @@
     malloc_set_zone_name(zone, NULL); // Deallocate zone name wherever it may reside PR_7701095
     malloc_zone_unregister(zone);
     zone->destroy(zone);
+}
+
+/* called from the {put,set,unset}env routine */
+__private_extern__ void
+__malloc_check_env_name(const char *name)
+{
+    MALLOC_LOCK();
+    /*
+     * <rdar://problem/8686255>
+     * 
+     * 2. malloc will no longer take notice of *programmatic* changes to the MALLOC_* environment variables 
+     * (i.e. calls to putenv() or setenv() that manipulate these environment variables.)
+     *
+     */
+#if 0 
+    if(malloc_def_zone_state == 2 && strncmp(name, "Malloc", 6) == 0)
+	malloc_def_zone_state = 1;
+#endif
+    MALLOC_UNLOCK();
 }
 
 /*********	Block creation and manipulation	************/
@@ -1373,7 +1393,6 @@
 extern void __stack_logging_fork_prepare();
 extern void __stack_logging_fork_parent();
 extern void __stack_logging_fork_child();
-extern void __stack_logging_early_finished();
 
 void
 _malloc_fork_prepare() {