1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/memory/build/jemalloc_config.c Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,34 @@ 1.4 +/* This Source Code Form is subject to the terms of the Mozilla Public 1.5 + * License, v. 2.0. If a copy of the MPL was not distributed with this file, 1.6 + * You can obtain one at http://mozilla.org/MPL/2.0/. */ 1.7 + 1.8 +#ifdef MOZ_JEMALLOC3 1.9 + 1.10 +#define MOZ_JEMALLOC_IMPL 1.11 + 1.12 +#include "mozmemory_wrap.h" 1.13 +#include "mozilla/Types.h" 1.14 + 1.15 +/* Override some jemalloc defaults */ 1.16 +MFBT_DATA const char * je_(malloc_conf) = "narenas:1,lg_chunk:20"; 1.17 + 1.18 +#ifdef ANDROID 1.19 +#include <android/log.h> 1.20 + 1.21 +static void 1.22 +_je_malloc_message(void *cbopaque, const char *s) 1.23 +{ 1.24 + __android_log_print(ANDROID_LOG_INFO, "GeckoJemalloc", "%s", s); 1.25 +} 1.26 + 1.27 +void (*je_(malloc_message))(void *, const char *s) = _je_malloc_message; 1.28 +#endif 1.29 + 1.30 +#endif /* MOZ_JEMALLOC3 */ 1.31 + 1.32 +/* Provide an abort function for use in jemalloc code */ 1.33 +#include <mozilla/Assertions.h> 1.34 + 1.35 +void moz_abort() { 1.36 + MOZ_CRASH(); 1.37 +}