Bug 721784 - Don't configure sqlite to use jemalloc on Android [r=mak]

This commit is contained in:
Matt Brubeck 2012-04-12 12:13:23 -07:00
parent eff411d536
commit 0503e0a360
2 changed files with 15 additions and 3 deletions

View File

@ -55,6 +55,18 @@ ifeq ($(OS_ARCH),Linux)
DEFINES += -DXP_LINUX DEFINES += -DXP_LINUX
endif endif
# Don't use the jemalloc allocator on Android, because we can't guarantee
# that Gecko will configure sqlite before it is first used (bug 730495).
#
# Note: On Windows our sqlite build assumes we use jemalloc. If you disable
# MOZ_STORAGE_MEMORY on Windows, you will also need to change the "ifdef
# MOZ_MEMORY" options in db/sqlite3/src/Makefile.in.
ifdef MOZ_MEMORY
ifneq ($(OS_TARGET), Android)
DEFINES += -DMOZ_STORAGE_MEMORY
endif
endif
EXPORTS_NAMESPACES = mozilla/storage EXPORTS_NAMESPACES = mozilla/storage
EXPORTS_mozilla/storage = \ EXPORTS_mozilla/storage = \

View File

@ -529,7 +529,7 @@ Service::shutdown()
sqlite3_vfs *ConstructTelemetryVFS(); sqlite3_vfs *ConstructTelemetryVFS();
#ifdef MOZ_MEMORY #ifdef MOZ_STORAGE_MEMORY
# include "jemalloc.h" # include "jemalloc.h"
namespace { namespace {
@ -599,7 +599,7 @@ const sqlite3_mem_methods memMethods = {
} // anonymous namespace } // anonymous namespace
#endif // MOZ_MEMORY #endif // MOZ_STORAGE_MEMORY
nsresult nsresult
Service::initialize() Service::initialize()
@ -608,7 +608,7 @@ Service::initialize()
int rc; int rc;
#ifdef MOZ_MEMORY #ifdef MOZ_STORAGE_MEMORY
rc = ::sqlite3_config(SQLITE_CONFIG_MALLOC, &memMethods); rc = ::sqlite3_config(SQLITE_CONFIG_MALLOC, &memMethods);
if (rc != SQLITE_OK) if (rc != SQLITE_OK)
return convertResultCode(rc); return convertResultCode(rc);