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 <c.padhi@samsung.com>
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);