From 277c4c6dfbb2afa98675f7aab0820a899f6c91a8 Mon Sep 17 00:00:00 2001 From: Kelsey Gilbert Date: Fri, 28 Feb 2025 21:14:52 +0000 Subject: [PATCH] Bug 1950946 - Remove #define realloc for graphite2. r=gfx-reviewers,aosmond Replacing realloc via define breaks libc++19.1.7: ``` In file included from Unified_cpp_gfx_graphite2_src0.cpp:29: In file included from /build/firefox-135.0.1/gfx/graphite2/src/Collider.cpp:31: In file included from /build/firefox-135.0.1/objdir/dist/stl_wrappers/functional:62: In file included from /build/firefox-135.0.1/objdir/dist/system_wrappers/functional:3: In file included from /nix/store/j34khyjjc2i4sxyxfk86bwcxlrz36z6g-libcxx-aarch64-unknown-linux-gnu-19.1.7-dev/include/c++/v1/functional:552: In file included from /nix/store/j34khyjjc2i4sxyxfk86bwcxlrz36z6g-libcxx-aarch64-unknown-linux-gnu-19.1.7-dev/include/c++/v1/__functional/boyer_moore_searcher.h:27: In file included from /build/firefox-135.0.1/objdir/dist/stl_wrappers/vector:62: In file included from /build/firefox-135.0.1/objdir/dist/system_wrappers/vector:3: In file included from /nix/store/j34khyjjc2i4sxyxfk86bwcxlrz36z6g-libcxx-aarch64-unknown-linux-gnu-19.1.7-dev/include/c++/v1/vector:3023: In file included from /build/firefox-135.0.1/objdir/dist/system_wrappers/locale:3: /nix/store/j34khyjjc2i4sxyxfk86bwcxlrz36z6g-libcxx-aarch64-unknown-linux-gnu-19.1.7-dev/include/c++/v1/locale:2458:26: error: no member named 'moz_xrealloc' in namespace 'std' 2458 | _Tp* __t = (_Tp*)std::realloc(__owns ? __b.get() : 0, __new_cap); | ^~~~~ /build/firefox-135.0.1/objdir/dist/include/mozilla/mozalloc.h:82:16: note: 'moz_xrealloc' declared here 82 | MFBT_API void* moz_xrealloc(void* ptr, size_t size) MOZ_INFALLIBLE_ALLOCATOR; ``` We no longer support GCC 5.4, so we shouldn't need this. Differential Revision: https://phabricator.services.mozilla.com/D239955 --- gfx/graphite2/src/MozGrMalloc.h | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/gfx/graphite2/src/MozGrMalloc.h b/gfx/graphite2/src/MozGrMalloc.h index b8eb58f33fb9..eb546611212a 100755 --- a/gfx/graphite2/src/MozGrMalloc.h +++ b/gfx/graphite2/src/MozGrMalloc.h @@ -12,17 +12,8 @@ #include "mozilla/mozalloc.h" -#if defined(XP_LINUX) && !defined(ANDROID) - -#define malloc moz_xmalloc -#define calloc moz_xcalloc -#define realloc moz_xrealloc - -#else - // extern "C" is needed for the Solaris build, while the inline -// functions are needed for the MinGW build. They break gcc 5.4.0 -// on Linux however, so keep the old #define's above for Linux +// functions are needed for the MinGW build. extern "C" inline void* malloc(size_t size) { @@ -39,6 +30,4 @@ extern "C" inline void* realloc(void *ptr, size_t size) return moz_xrealloc(ptr, size); } -#endif // defined(XP_LINUX) - #endif // MOZ_GR_MALLOC_H