Bug 526389 - Skip redefinition of memory allocation functions for MacOS X and Linux. r=jasone
authorTakanori MATSUURA <t.matsuu@gmail.com>
Sun, 07 Mar 2010 10:53:46 +0100
changeset 39043 7a2802932585e73f9fc817497b1d323f820d8fc9
parent 39042 c2630edd612be6e301616c5219327560ea3955f5
child 39044 113a87ef5bfa3d8c3a34beb1d056e88664f0e80a
push id11990
push userdgottwald@mozilla.com
push dateSun, 07 Mar 2010 09:54:32 +0000
treeherdermozilla-central@7a2802932585 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjasone
bugs526389
milestone1.9.3a3pre
Bug 526389 - Skip redefinition of memory allocation functions for MacOS X and Linux. r=jasone
memory/jemalloc/jemalloc.h
--- a/memory/jemalloc/jemalloc.h
+++ b/memory/jemalloc/jemalloc.h
@@ -74,26 +74,31 @@ typedef struct {
 	 * Current memory usage statistics.
 	 */
 	size_t	mapped;		/* Bytes mapped (not necessarily committed). */
 	size_t	committed;	/* Bytes committed (readable/writable). */
 	size_t	allocated;	/* Bytes allocted (in use by application). */
 	size_t	dirty;		/* Bytes dirty (committed unused pages). */
 } jemalloc_stats_t;
 
-#ifndef MOZ_MEMORY_DARWIN
+/* Darwin and Linux already have memory allocation functions */
+#if (!defined(MOZ_MEMORY_DARWIN) && !defined(MOZ_MEMORY_LINUX))
 void	*malloc(size_t size);
 void	*valloc(size_t size);
 void	*calloc(size_t num, size_t size);
 void	*realloc(void *ptr, size_t size);
 void	free(void *ptr);
-#endif
+int	posix_memalign(void **memptr, size_t alignment, size_t size);
+#endif /* MOZ_MEMORY_DARWIN, MOZ_MEMORY_LINUX */
 
-int	posix_memalign(void **memptr, size_t alignment, size_t size);
+/* Linux has memalign */
+#if !defined(MOZ_MEMORY_LINUX)
 void	*memalign(size_t alignment, size_t size);
+#endif /* MOZ_MEMORY_LINUX */
+
 size_t	malloc_usable_size(const void *ptr);
 void	jemalloc_stats(jemalloc_stats_t *stats);
 
 #ifdef __cplusplus
 } /* extern "C" */
 #endif
 
 #endif /* _JEMALLOC_H_ */