1From 0d9caac4f65de9a03ad29f077499223a6918eb81 Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Wed, 13 Feb 2019 09:51:14 -0800
4Subject: [PATCH] __libc_malloc is internal to glibc
5
6its better to use generic API so it remains portable
7
8Upstream-Status: Pending
9Signed-off-by: Khem Raj <raj.khem@gmail.com>
10
11---
12 base/process/memory_linux.cc | 4 ++--
13 1 file changed, 2 insertions(+), 2 deletions(-)
14
15diff --git a/base/process/memory_linux.cc b/base/process/memory_linux.cc
16index 8973d7c27f..12245131e3 100644
17--- a/base/process/memory_linux.cc
18+++ b/base/process/memory_linux.cc
19@@ -111,7 +111,7 @@ bool UncheckedMalloc(size_t size, void** result) {
20 #elif defined(MEMORY_TOOL_REPLACES_ALLOCATOR) || !defined(LIBC_GLIBC)
21   *result = malloc(size);
22 #elif defined(LIBC_GLIBC)
23-  *result = __libc_malloc(size);
24+  *result = malloc(size);
25 #endif
26   return *result != nullptr;
27 }
28@@ -122,7 +122,7 @@ void UncheckedFree(void* ptr) {
29 #elif defined(MEMORY_TOOL_REPLACES_ALLOCATOR) || !defined(LIBC_GLIBC)
30   free(ptr);
31 #elif defined(LIBC_GLIBC)
32-  __libc_free(ptr);
33+  free(ptr);
34 #endif
35 }
36
37