Replace custom stdlib implementations with the compiler defaults

This commit is contained in:
wuggy 2026-04-21 23:43:14 -07:00
commit ef314d225f
3 changed files with 9 additions and 22 deletions

View file

@ -16,19 +16,8 @@ option('--enable-jemalloc', env='MOZ_MEMORY',
def jemalloc(value, target, build_project, c_compiler):
if value.origin != 'default':
return bool(value) or None
if build_project == 'js':
return True
if target.kernel == 'Darwin' and target.cpu == 'x86_64':
# Don't enable by default on 32-bits OSX. See bug 702250.
return True
if target.kernel == 'WINNT' and c_compiler.type in ('msvc', 'clang-cl'):
return True
if target.kernel == 'Linux':
return True
# Default to the compiler/CRT allocator unless explicitly requested.
return None
set_config('MOZ_MEMORY', jemalloc)
@ -77,13 +66,11 @@ option('--enable-replace-malloc',
@depends('--enable-replace-malloc', jemalloc, milestone, build_project)
def replace_malloc(value, jemalloc, milestone, build_project):
# Enable on central for the debugging opportunities it adds.
if value and not jemalloc:
die('--enable-replace-malloc requires --enable-jemalloc')
if value.origin != 'default':
return bool(value) or None
if milestone.is_nightly and jemalloc and build_project != 'js':
return True
return None
set_config('MOZ_REPLACE_MALLOC', replace_malloc)
set_define('MOZ_REPLACE_MALLOC', replace_malloc)

View file

@ -1035,8 +1035,8 @@ WINNT|Darwin|Android)
;;
*)
if test -z "$GNU_CC"; then
STL_FLAGS="-I${DIST}/stl_wrappers"
WRAP_STL_INCLUDES=1
STL_FLAGS=
WRAP_STL_INCLUDES=
fi
;;
esac

View file

@ -276,8 +276,8 @@ case "$target" in
unset _MSVC_VER_FILTER
WRAP_STL_INCLUDES=1
STL_FLAGS="-I${DIST}/stl_wrappers"
WRAP_STL_INCLUDES=
STL_FLAGS=
CFLAGS="$CFLAGS -D_HAS_EXCEPTIONS=0"
CXXFLAGS="$CXXFLAGS -D_HAS_EXCEPTIONS=0"
else
@ -1231,8 +1231,8 @@ Darwin)
;;
*)
if test -z "$GNU_CC"; then
STL_FLAGS="-I${DIST}/stl_wrappers"
WRAP_STL_INCLUDES=1
STL_FLAGS=
WRAP_STL_INCLUDES=
fi
;;
esac