1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
|
$NetBSD: patch-memory_mozalloc_mozalloc.h,v 1.3 2014/02/20 13:19:03 ryoon Exp $
https://bugzilla.mozilla.org/show_bug.cgi?id=928808
--- memory/mozalloc/mozalloc.h.orig 2013-10-25 22:27:35.000000000 +0000
+++ memory/mozalloc/mozalloc.h
@@ -39,15 +39,6 @@
# define MOZALLOC_EXPORT
#endif
-
-#if defined(MOZ_ALWAYS_INLINE_EVEN_DEBUG)
-# define MOZALLOC_INLINE MOZ_ALWAYS_INLINE_EVEN_DEBUG
-#elif defined(HAVE_FORCEINLINE)
-# define MOZALLOC_INLINE __forceinline
-#else
-# define MOZALLOC_INLINE inline
-#endif
-
/* Workaround build problem with Sun Studio 12 */
#if defined(__SUNPRO_C) || defined(__SUNPRO_CC)
# undef NS_WARN_UNUSED_RESULT
@@ -171,15 +162,6 @@ MOZALLOC_EXPORT void* moz_valloc(size_t
* that |::operator new() throw(std::bad_alloc)| will never return NULL.
*/
-/* NB: This is defined just to silence vacuous warnings about symbol
- * visibility on OS X/gcc. These symbols are force-inline and not
- * exported. */
-#if defined(XP_MACOSX)
-# define MOZALLOC_EXPORT_NEW MOZALLOC_EXPORT
-#else
-# define MOZALLOC_EXPORT_NEW
-#endif
-
#if defined(ANDROID) || defined(_MSC_VER)
/*
* Android doesn't fully support exceptions, so its <new> header
@@ -195,53 +177,29 @@ MOZALLOC_EXPORT void* moz_valloc(size_t
#define MOZALLOC_THROW_BAD_ALLOC MOZALLOC_THROW_BAD_ALLOC_IF_HAS_EXCEPTIONS
-MOZALLOC_EXPORT_NEW MOZALLOC_INLINE
-void* operator new(size_t size) MOZALLOC_THROW_BAD_ALLOC
-{
- return moz_xmalloc(size);
-}
-
-MOZALLOC_EXPORT_NEW MOZALLOC_INLINE
-void* operator new(size_t size, const std::nothrow_t&) MOZALLOC_THROW_IF_HAS_EXCEPTIONS
-{
- return moz_malloc(size);
-}
-
-MOZALLOC_EXPORT_NEW MOZALLOC_INLINE
-void* operator new[](size_t size) MOZALLOC_THROW_BAD_ALLOC
-{
- return moz_xmalloc(size);
-}
-
-MOZALLOC_EXPORT_NEW MOZALLOC_INLINE
-void* operator new[](size_t size, const std::nothrow_t&) MOZALLOC_THROW_IF_HAS_EXCEPTIONS
-{
- return moz_malloc(size);
-}
-
-MOZALLOC_EXPORT_NEW MOZALLOC_INLINE
-void operator delete(void* ptr) MOZALLOC_THROW_IF_HAS_EXCEPTIONS
-{
- return moz_free(ptr);
-}
-
-MOZALLOC_EXPORT_NEW MOZALLOC_INLINE
-void operator delete(void* ptr, const std::nothrow_t&) MOZALLOC_THROW_IF_HAS_EXCEPTIONS
-{
- return moz_free(ptr);
-}
-
-MOZALLOC_EXPORT_NEW MOZALLOC_INLINE
-void operator delete[](void* ptr) MOZALLOC_THROW_IF_HAS_EXCEPTIONS
-{
- return moz_free(ptr);
-}
-
-MOZALLOC_EXPORT_NEW MOZALLOC_INLINE
-void operator delete[](void* ptr, const std::nothrow_t&) MOZALLOC_THROW_IF_HAS_EXCEPTIONS
-{
- return moz_free(ptr);
-}
+MOZALLOC_EXPORT
+void* operator new(size_t size) MOZALLOC_THROW_BAD_ALLOC;
+
+MOZALLOC_EXPORT
+void* operator new(size_t size, const std::nothrow_t&) MOZALLOC_THROW_IF_HAS_EXCEPTIONS;
+
+MOZALLOC_EXPORT
+void* operator new[](size_t size) MOZALLOC_THROW_BAD_ALLOC;
+
+MOZALLOC_EXPORT
+void* operator new[](size_t size, const std::nothrow_t&) MOZALLOC_THROW_IF_HAS_EXCEPTIONS;
+
+MOZALLOC_EXPORT
+void operator delete(void* ptr) MOZALLOC_THROW_IF_HAS_EXCEPTIONS;
+
+MOZALLOC_EXPORT
+void operator delete(void* ptr, const std::nothrow_t&) MOZALLOC_THROW_IF_HAS_EXCEPTIONS;
+
+MOZALLOC_EXPORT
+void operator delete[](void* ptr) MOZALLOC_THROW_IF_HAS_EXCEPTIONS;
+
+MOZALLOC_EXPORT
+void operator delete[](void* ptr, const std::nothrow_t&) MOZALLOC_THROW_IF_HAS_EXCEPTIONS;
/*
@@ -263,29 +221,17 @@ void operator delete[](void* ptr, const
* (4) the matching system |operator delete(void*) throw(std::bad_alloc)|
*/
-MOZALLOC_INLINE
-void* operator new(size_t size, const mozilla::fallible_t&) MOZALLOC_THROW_IF_HAS_EXCEPTIONS
-{
- return moz_malloc(size);
-}
-
-MOZALLOC_INLINE
-void* operator new[](size_t size, const mozilla::fallible_t&) MOZALLOC_THROW_IF_HAS_EXCEPTIONS
-{
- return moz_malloc(size);
-}
-
-MOZALLOC_INLINE
-void operator delete(void* ptr, const mozilla::fallible_t&) MOZALLOC_THROW_IF_HAS_EXCEPTIONS
-{
- moz_free(ptr);
-}
-
-MOZALLOC_INLINE
-void operator delete[](void* ptr, const mozilla::fallible_t&) MOZALLOC_THROW_IF_HAS_EXCEPTIONS
-{
- moz_free(ptr);
-}
+MOZALLOC_EXPORT
+void* operator new(size_t size, const mozilla::fallible_t&) MOZALLOC_THROW_IF_HAS_EXCEPTIONS;
+
+MOZALLOC_EXPORT
+void* operator new[](size_t size, const mozilla::fallible_t&) MOZALLOC_THROW_IF_HAS_EXCEPTIONS;
+
+MOZALLOC_EXPORT
+void operator delete(void* ptr, const mozilla::fallible_t&) MOZALLOC_THROW_IF_HAS_EXCEPTIONS;
+
+MOZALLOC_EXPORT
+void operator delete[](void* ptr, const mozilla::fallible_t&) MOZALLOC_THROW_IF_HAS_EXCEPTIONS;
#endif /* ifdef __cplusplus */
|