Bug 1423094 - Remove USE_STATIC_LIBS=True-related code in mozalloc. r?build
--- a/memory/mozalloc/mozalloc.cpp
+++ b/memory/mozalloc/mozalloc.cpp
@@ -2,23 +2,17 @@
* vim: sw=4 ts=4 et :
*/
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#include <stddef.h> // for size_t
-// Building with USE_STATIC_LIBS = True sets -MT instead of -MD. -MT sets _MT,
-// while -MD sets _MT and _DLL.
-#if defined(_MT) && !defined(_DLL)
-#define MOZ_STATIC_RUNTIME
-#endif
-
-#if defined(MOZ_MEMORY) && !defined(MOZ_STATIC_RUNTIME)
+#if defined(MOZ_MEMORY)
// mozalloc.cpp is part of the same library as mozmemory, thus MOZ_MEMORY_IMPL
// is needed.
#define MOZ_MEMORY_IMPL
#include "mozmemory_wrap.h"
#if defined(XP_DARWIN)
#include <malloc/malloc.h> // for malloc_size
#endif
@@ -192,17 +186,16 @@ moz_xvalloc(size_t size)
if (UNLIKELY(!ptr)) {
mozalloc_handle_oom(size);
return moz_xvalloc(size);
}
return ptr;
}
#endif // if defined(HAVE_VALLOC)
-#ifndef MOZ_STATIC_RUNTIME
size_t
moz_malloc_usable_size(void *ptr)
{
if (!ptr)
return 0;
#if defined(XP_DARWIN)
return malloc_size(ptr);
@@ -236,9 +229,8 @@ moz_malloc_enclosing_size_of(const void
#if defined(MOZ_MEMORY)
jemalloc_ptr_info_t info;
jemalloc_ptr_info(ptr, &info);
return jemalloc_ptr_is_live(&info) ? info.size : 0;
#else
return 0;
#endif
}
-#endif
--- a/memory/mozalloc/winheap.cpp
+++ b/memory/mozalloc/winheap.cpp
@@ -3,23 +3,17 @@
*/
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#include "mozilla/Types.h"
#include <windows.h>
-// Building with USE_STATIC_LIBS = True sets -MT instead of -MD. -MT sets _MT,
-// while -MD sets _MT and _DLL.
-#if defined(_MT) && !defined(_DLL)
-#define MOZ_STATIC_RUNTIME
-#endif
-
-#if defined(MOZ_MEMORY) && !defined(MOZ_STATIC_RUNTIME)
+#if defined(MOZ_MEMORY)
// mozalloc.cpp is part of the same library as mozmemory, thus MOZ_MEMORY_IMPL
// is needed.
#define MOZ_MEMORY_IMPL
#include "mozmemory_wrap.h"
// See mozmemory_wrap.h for more details. This file is part of libmozglue, so
// it needs to use _impl suffixes. However, with libmozglue growing, this is
// becoming cumbersome, so we will likely use a malloc.h wrapper of some sort