michael@0: # -*- Mode: python; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 40 -*- michael@0: # vim: set filetype=python: michael@0: # This Source Code Form is subject to the terms of the Mozilla Public michael@0: # License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: # file, You can obtain one at http://mozilla.org/MPL/2.0/. michael@0: michael@0: EXPORTS += [ michael@0: 'mozmemory.h', michael@0: 'mozmemory_wrap.h', michael@0: ] michael@0: michael@0: DEFINES['MOZ_MEMORY_IMPL'] = True michael@0: michael@0: if CONFIG['MOZ_REPLACE_MALLOC']: michael@0: EXPORTS += [ michael@0: 'malloc_decls.h', michael@0: 'replace_malloc.h', michael@0: ] michael@0: DEFINES['MOZ_REPLACE_MALLOC'] = True michael@0: michael@0: SOURCES += [ michael@0: 'jemalloc_config.c', michael@0: 'mozmemory_wrap.c', michael@0: ] michael@0: michael@0: if CONFIG['MOZ_JEMALLOC3']: michael@0: SOURCES += [ michael@0: 'mozjemalloc_compat.c', michael@0: ] michael@0: GENERATED_INCLUDES += ['../jemalloc/src/include'] michael@0: if CONFIG['_MSC_VER']: michael@0: LOCAL_INCLUDES += ['/memory/jemalloc/src/include/msvc_compat'] michael@0: michael@0: if CONFIG['MOZ_REPLACE_MALLOC']: michael@0: SOURCES += [ michael@0: 'replace_malloc.c', michael@0: ] michael@0: michael@0: LIBRARY_NAME = 'memory' michael@0: michael@0: # Keep jemalloc separated when mozglue is statically linked michael@0: if CONFIG['MOZ_MEMORY'] and (CONFIG['OS_TARGET'] in ('WINNT', 'Darwin', 'Android') or michael@0: CONFIG['MOZ_NATIVE_JEMALLOC']): michael@0: FINAL_LIBRARY = 'mozglue' michael@0: michael@0: if CONFIG['MOZ_REPLACE_MALLOC'] and CONFIG['OS_TARGET'] == 'Darwin': michael@0: # The zone allocator for OSX needs some jemalloc internal functions michael@0: LOCAL_INCLUDES += ['/memory/jemalloc/src/include']