All pastes #2126651 Raw Edit

Stuff

public text v1 · immutable
#2126651 ·published 2012-03-10 18:23 UTC
rendered paste body
--- dmalloc.c
+++ dmalloc1.c
@@ -296,7 +296,7 @@
 static pthread_key_t thread_malloc_key;
 static pthread_once_t thread_malloc_once = PTHREAD_ONCE_INIT;
 static struct slglobaldata sldepots[NDEPOTS];
-
+static int malloc_init_flag = 0;
 static int opt_madvise = 0;
 static int opt_free = 0;
 static int opt_cache = 4;
@@ -353,7 +353,10 @@
 malloc_init(void)
 {
 	const char *p = NULL;
-
+	
+	if (malloc_init_flag == 1)
+		return;
+		
 	Regions[0].mask = -1; /* disallow activity in lowest region */
 
 	if (issetugid() == 0)
@@ -399,6 +402,7 @@
 
 	UTRACE((void *) -1, 0, NULL);
 	_nmalloc_thr_init();
+	malloc_init_flag = 1;
 }
 
 /*