[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [59597] trunk/blender/intern/guardedalloc/ intern/mallocn.c: should fix builds for osx

Campbell Barton ideasman42 at gmail.com
Wed Aug 28 13:22:30 CEST 2013


Revision: 59597
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=59597
Author:   campbellbarton
Date:     2013-08-28 11:22:29 +0000 (Wed, 28 Aug 2013)
Log Message:
-----------
should fix builds for osx

Modified Paths:
--------------
    trunk/blender/intern/guardedalloc/intern/mallocn.c

Modified: trunk/blender/intern/guardedalloc/intern/mallocn.c
===================================================================
--- trunk/blender/intern/guardedalloc/intern/mallocn.c	2013-08-28 11:16:14 UTC (rev 59596)
+++ trunk/blender/intern/guardedalloc/intern/mallocn.c	2013-08-28 11:22:29 UTC (rev 59597)
@@ -49,8 +49,9 @@
 #endif
 
 /* only for utility functions */
-#if defined(__GNUC__)
+#if defined(__GNUC__) && defined(__linux__)
 #include <malloc.h>
+#  define HAVE_MALLOC_H
 #endif
 
 #include "MEM_guardedalloc.h"
@@ -625,7 +626,7 @@
 	MemHead *membl;
 	MemPrintBlock *pb, *printblock;
 	int totpb, a, b;
-#ifdef __GNUC__
+#ifdef HAVE_MALLOC_H
 	size_t mem_in_use_slop;
 #endif
 	mem_lock_thread();
@@ -647,7 +648,7 @@
 		totpb++;
 		pb++;
 
-#ifdef __GNUC__
+#ifdef HAVE_MALLOC_H
 		mem_in_use_slop += (sizeof(MemHead) + sizeof(MemTail) +
 		                    malloc_usable_size((void *)membl)) - membl->len;
 #endif
@@ -680,7 +681,7 @@
 	       (double)mem_in_use / (double)(1024 * 1024));
 	printf("peak memory len: %.3f MB\n",
 	       (double)peak_mem / (double)(1024 * 1024));
-#ifdef __GNUC__
+#ifdef HAVE_MALLOC_H
 	printf("slop memory len: %.3f MB\n",
 	       (double)mem_in_use_slop / (double)(1024 * 1024));
 #endif
@@ -694,7 +695,8 @@
 	
 	mem_unlock_thread();
 
-#if 0 /* GLIBC only */
+#ifdef HAVE_MALLOC_H /* GLIBC only */
+	printf("System Statistics:\n");
 	malloc_stats();
 #endif
 }




More information about the Bf-blender-cvs mailing list