From ac8fd2fc4d063ad13477c4fc35f624005468ec2e Mon Sep 17 00:00:00 2001 From: Chandan Padhi Date: Fri, 3 Aug 2018 18:18:23 +0530 Subject: [PATCH] [M67 Dev][Tizen] Redirect UncheckedMalloc to malloc for Tizen On Tizen, BufferManager::DoBufferData tries to call free() to deallocate a memory that was allocated by tc_malloc in UncheckedMalloc(), which caused crash for most web pages. To fix it, we redirect UncheckedMalloc to malloc for Tizen. Seems like we do not use tcmalloc for chromium-efl in a consistent manner. We should either fix it or disable tcmalloc. Reference: http://165.213.202.130/gerrit/#/c/71875/ http://165.213.202.130/gerrit/#/c/72475/ Change-Id: Iacc6776736c193d6fa66707ff28048d42267ac12 Signed-off-by: Chandan Padhi --- base/process/memory_linux.cc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/base/process/memory_linux.cc b/base/process/memory_linux.cc index 21b2069..ca9cd26 100644 --- a/base/process/memory_linux.cc +++ b/base/process/memory_linux.cc @@ -100,8 +100,10 @@ bool AdjustOOMScore(ProcessId process, int score) { bool UncheckedMalloc(size_t size, void** result) { #if BUILDFLAG(USE_ALLOCATOR_SHIM) *result = allocator::UncheckedAlloc(size); +// FIXME: Since we do not use tcmalloc for chromium-efl in a consistent +// manner, we should either fix it or disable tcmalloc. #elif defined(MEMORY_TOOL_REPLACES_ALLOCATOR) || \ - (!defined(LIBC_GLIBC) && !defined(USE_TCMALLOC)) + (!defined(LIBC_GLIBC) && !defined(USE_TCMALLOC) || defined(USE_EFL)) *result = malloc(size); #elif defined(LIBC_GLIBC) && !defined(USE_TCMALLOC) *result = __libc_malloc(size); -- 2.7.4