Bug 1746540 - Move --enable-logrefcnt to python configure. r=nika,firefox-build-system-reviewers,mhentges

And simplify the defines it sets.

Differential Revision: https://phabricator.services.mozilla.com/D134099
This commit is contained in:
Mike Hommey 2021-12-17 22:52:09 +00:00
Родитель 3e80feeb1d
Коммит 86100100a6
8 изменённых файлов: 22 добавлений и 44 удалений

Просмотреть файл

@ -91,7 +91,6 @@ def old_configure_options(*options):
@old_configure_options(
"--cache-file",
"--datadir",
"--enable-logrefcnt",
"--enable-negotiateauth",
"--enable-official-branding",
"--enable-parental-controls",

Просмотреть файл

@ -3350,8 +3350,7 @@ FilterNodeLightingSoftware<LightType, LightingType>::FilterNodeLightingSoftware(
const char* aTypeName)
: mLock("FilterNodeLightingSoftware"),
mSurfaceScale(0)
#if defined(MOZILLA_INTERNAL_API) && \
(defined(DEBUG) || defined(FORCE_BUILD_REFCNT_LOGGING))
#if defined(MOZILLA_INTERNAL_API) && defined(NS_BUILD_REFCNT_LOGGING)
,
mTypeName(aTypeName)
#endif

Просмотреть файл

@ -743,8 +743,7 @@ class FilterNodeOpacitySoftware : public FilterNodeSoftware {
template <typename LightType, typename LightingType>
class FilterNodeLightingSoftware : public FilterNodeSoftware {
public:
#if defined(MOZILLA_INTERNAL_API) && \
(defined(DEBUG) || defined(FORCE_BUILD_REFCNT_LOGGING))
#if defined(MOZILLA_INTERNAL_API) && defined(NS_BUILD_REFCNT_LOGGING)
// Helpers for refcounted
const char* typeName() const override { return mTypeName; }
size_t typeSize() const override { return sizeof(*this); }
@ -777,8 +776,7 @@ class FilterNodeLightingSoftware : public FilterNodeSoftware {
Float mSurfaceScale;
Size mKernelUnitLength;
DeviceColor mColor;
#if defined(MOZILLA_INTERNAL_API) && \
(defined(DEBUG) || defined(FORCE_BUILD_REFCNT_LOGGING))
#if defined(MOZILLA_INTERNAL_API) && defined(NS_BUILD_REFCNT_LOGGING)
const char* mTypeName;
#endif
};

Просмотреть файл

@ -27,8 +27,7 @@
# include "nsXPCOM.h"
#endif
#if defined(MOZILLA_INTERNAL_API) && \
(defined(DEBUG) || defined(FORCE_BUILD_REFCNT_LOGGING))
#if defined(MOZILLA_INTERNAL_API) && defined(NS_BUILD_REFCNT_LOGGING)
# define MOZ_REFCOUNTED_LEAK_CHECKING
#endif

Просмотреть файл

@ -1609,26 +1609,6 @@ AC_SUBST_LIST(MOZ_OPTIMIZE_FLAGS)
AC_SUBST_LIST(MOZ_OPTIMIZE_LDFLAGS)
AC_SUBST_LIST(MOZ_PGO_OPTIMIZE_FLAGS)
dnl ========================================================
dnl = Enable runtime logging
dnl ========================================================
AC_DEFINE(MOZ_LOGGING)
AC_DEFINE(FORCE_PR_LOG)
dnl ========================================================
dnl = This will enable logging of addref, release, ctor, dtor.
dnl ========================================================
_ENABLE_LOGREFCNT=42
MOZ_ARG_ENABLE_BOOL(logrefcnt,
[ --enable-logrefcnt Enable logging of refcounts (default=debug) ],
_ENABLE_LOGREFCNT=1,
_ENABLE_LOGREFCNT= )
if test "$_ENABLE_LOGREFCNT" = "1"; then
AC_DEFINE(FORCE_BUILD_REFCNT_LOGGING)
elif test -z "$_ENABLE_LOGREFCNT"; then
AC_DEFINE(NO_BUILD_REFCNT_LOGGING)
fi
case "${OS_TARGET}" in
Android|WINNT|Darwin)
MOZ_GLUE_IN_PROGRAM=

Просмотреть файл

@ -2746,3 +2746,19 @@ with only_when(toolkit_gtk):
set_config("MOZ_ENABLE_LIBPROXY", True)
set_define("MOZ_ENABLE_LIBPROXY", True)
# Enable runtime logging
# ==============================================================
set_define("MOZ_LOGGING", True)
set_define("FORCE_PR_LOG", True)
# This will enable logging of addref, release, ctor, dtor.
# ==============================================================
option(
"--enable-logrefcnt",
default=moz_debug,
help="{Enable|Disable} logging of refcounts",
)
set_define("NS_BUILD_REFCNT_LOGGING", True, when="--enable-logrefcnt")

Просмотреть файл

@ -151,19 +151,6 @@
#define XPCOM_API(type) NS_EXTERN_C type
#if (defined(DEBUG) || defined(FORCE_BUILD_REFCNT_LOGGING))
/* Make refcnt logging part of the build. This doesn't mean that
* actual logging will occur (that requires a separate enable; see
* nsTraceRefcnt and nsISupportsImpl.h for more information). */
# define NS_BUILD_REFCNT_LOGGING
#endif
/* If NO_BUILD_REFCNT_LOGGING is defined then disable refcnt logging
* in the build. This overrides FORCE_BUILD_REFCNT_LOGGING. */
#if defined(NO_BUILD_REFCNT_LOGGING)
# undef NS_BUILD_REFCNT_LOGGING
#endif
/* If a program allocates memory for the lifetime of the app, it doesn't make
* sense to touch memory pages and free that memory at shutdown,
* unless we are running leak stats.

Просмотреть файл

@ -1133,7 +1133,7 @@ class nsTSubstring : public mozilla::detail::nsTStringRepr<T> {
nsTSubstring(char_type* aData, size_type aLength, DataFlags aDataFlags,
ClassFlags aClassFlags)
// XXXbz or can I just include nscore.h and use NS_BUILD_REFCNT_LOGGING?
#if defined(DEBUG) || defined(FORCE_BUILD_REFCNT_LOGGING)
#if defined(NS_BUILD_REFCNT_LOGGING)
# define XPCOM_STRING_CONSTRUCTOR_OUT_OF_LINE
;
#else
@ -1141,7 +1141,7 @@ class nsTSubstring : public mozilla::detail::nsTStringRepr<T> {
: base_string_type(aData, aLength, aDataFlags, aClassFlags) {
AssertValid();
}
#endif /* DEBUG || FORCE_BUILD_REFCNT_LOGGING */
#endif /* NS_BUILD_REFCNT_LOGGING */
void SetToEmptyBuffer() {
base_string_type::mData = char_traits::sEmptyBuffer;