void-packages/srcpkgs/chromium/patches/libc_malloc.patch
Đoàn Trần Công Danh c987560802 srcpkgs/c*: convert patches to -Np1
```sh
git grep -l '^patch_args=-Np0' "srcpkgs/$1*/template" |
while read template; do
	for p in ${template%/template}/patches/*; do
		sed -i '
			\,^[+-][+-][+-] /dev/null,b
			/^[*-]\+ [0-9]\+\(,[0-9]\+\)\? [*-]\+$/b
			s,^[*][*][*] ,&a/,
			/^--- /{
				s,\(^--- \)\(./\)*,\1a/,
				s,[.][Oo][Rr][Ii][Gg]\([	/]\),\1,
				s/[.][Oo][Rr][Ii][Gg]$//
				s/[.]patched[.]\([^.]\)/.\1/
				h
			}
			/^+++ -/{
				g
				s/^--- a/+++ b/
				b
			}
			s,\(^+++ \)\(./\)*,\1b/,
		' "$p"
	done
	sed -i '/^patch_args=/d' $template
done
```
2021-06-20 13:17:29 +07:00

26 lines
834 B
Diff

--- a/base/process/memory_linux.cc 2017-09-15 08:41:43.000000000 +0000
+++ b/base/process/memory_linux.cc 2017-09-15 08:44:39.804995469 +0000
@@ -21,6 +21,12 @@
#include "third_party/tcmalloc/chromium/src/gperftools/tcmalloc.h"
#endif
+#if defined(LIBC_GLIBC)
+extern "C" {
+extern void *__libc_malloc(size_t size);
+}
+#endif
+
namespace base {
size_t g_oom_size = 0U;
--- a/base/process/memory_linux.cc 2020-08-30 14:18:35.401132593 -0400
+++ b/base/process/memory_linux.cc 2020-08-30 14:19:08.030199189 -0400
@@ -141,7 +141,7 @@
(!defined(LIBC_GLIBC) && !BUILDFLAG(USE_TCMALLOC))
*result = malloc(size);
#elif defined(LIBC_GLIBC) && !BUILDFLAG(USE_TCMALLOC)
- *result = __libc_malloc(size);
+ *result = ::__libc_malloc(size);
#elif BUILDFLAG(USE_TCMALLOC)
*result = tc_malloc_skip_new_handler(size);
#endif