12faa5f1271587cda765f26bcf2951065300a01ffElliott Hughes/*
22faa5f1271587cda765f26bcf2951065300a01ffElliott Hughes * Copyright (C) 2010 The Android Open Source Project
32faa5f1271587cda765f26bcf2951065300a01ffElliott Hughes *
42faa5f1271587cda765f26bcf2951065300a01ffElliott Hughes * Licensed under the Apache License, Version 2.0 (the "License");
52faa5f1271587cda765f26bcf2951065300a01ffElliott Hughes * you may not use this file except in compliance with the License.
62faa5f1271587cda765f26bcf2951065300a01ffElliott Hughes * You may obtain a copy of the License at
72faa5f1271587cda765f26bcf2951065300a01ffElliott Hughes *
82faa5f1271587cda765f26bcf2951065300a01ffElliott Hughes *      http://www.apache.org/licenses/LICENSE-2.0
92faa5f1271587cda765f26bcf2951065300a01ffElliott Hughes *
102faa5f1271587cda765f26bcf2951065300a01ffElliott Hughes * Unless required by applicable law or agreed to in writing, software
112faa5f1271587cda765f26bcf2951065300a01ffElliott Hughes * distributed under the License is distributed on an "AS IS" BASIS,
122faa5f1271587cda765f26bcf2951065300a01ffElliott Hughes * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
132faa5f1271587cda765f26bcf2951065300a01ffElliott Hughes * See the License for the specific language governing permissions and
142faa5f1271587cda765f26bcf2951065300a01ffElliott Hughes * limitations under the License.
152faa5f1271587cda765f26bcf2951065300a01ffElliott Hughes */
166c21dc1bcafd83e90daa42a27dacd285278f3667Carl Shapiro
17fc0e3219edc9a5bf81b166e82fd5db2796eb6a0dBrian Carlstrom#ifndef ART_RUNTIME_BASE_MACROS_H_
18fc0e3219edc9a5bf81b166e82fd5db2796eb6a0dBrian Carlstrom#define ART_RUNTIME_BASE_MACROS_H_
196c21dc1bcafd83e90daa42a27dacd285278f3667Carl Shapiro
2012eb78e651f13f2c1f0c2c922048a5a213253adfCarl Shapiro#include <stddef.h>  // for size_t
2112eb78e651f13f2c1f0c2c922048a5a213253adfCarl Shapiro
227a00a3c6c9a3425ba8331ee8e479040731db651bBrian Carlstrom#define GCC_VERSION (__GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__)
2324782c6aa7abf396de057d7eb15035b4c594a3b4Shih-wei Liao
24a5d5cfda6239d8876937e75eba43222f639d2447Carl Shapiro// The COMPILE_ASSERT macro can be used to verify that a compile time
25a5d5cfda6239d8876937e75eba43222f639d2447Carl Shapiro// expression is true. For example, you could use it to verify the
26a5d5cfda6239d8876937e75eba43222f639d2447Carl Shapiro// size of a static array:
27a5d5cfda6239d8876937e75eba43222f639d2447Carl Shapiro//
28a5d5cfda6239d8876937e75eba43222f639d2447Carl Shapiro//   COMPILE_ASSERT(ARRAYSIZE(content_type_names) == CONTENT_NUM_TYPES,
29a5d5cfda6239d8876937e75eba43222f639d2447Carl Shapiro//                  content_type_names_incorrect_size);
30a5d5cfda6239d8876937e75eba43222f639d2447Carl Shapiro//
31a5d5cfda6239d8876937e75eba43222f639d2447Carl Shapiro// or to make sure a struct is smaller than a certain size:
32a5d5cfda6239d8876937e75eba43222f639d2447Carl Shapiro//
33a5d5cfda6239d8876937e75eba43222f639d2447Carl Shapiro//   COMPILE_ASSERT(sizeof(foo) < 128, foo_too_large);
34a5d5cfda6239d8876937e75eba43222f639d2447Carl Shapiro//
35a5d5cfda6239d8876937e75eba43222f639d2447Carl Shapiro// The second argument to the macro is the name of the variable. If
36a5d5cfda6239d8876937e75eba43222f639d2447Carl Shapiro// the expression is false, most compilers will issue a warning/error
37a5d5cfda6239d8876937e75eba43222f639d2447Carl Shapiro// containing the name of the variable.
38a5d5cfda6239d8876937e75eba43222f639d2447Carl Shapiro
39a5d5cfda6239d8876937e75eba43222f639d2447Carl Shapirotemplate <bool>
40a5d5cfda6239d8876937e75eba43222f639d2447Carl Shapirostruct CompileAssert {
41a5d5cfda6239d8876937e75eba43222f639d2447Carl Shapiro};
42a5d5cfda6239d8876937e75eba43222f639d2447Carl Shapiro
43a5d5cfda6239d8876937e75eba43222f639d2447Carl Shapiro#define COMPILE_ASSERT(expr, msg) \
44398f64b5805246765b699839b439e18c0dfbf2eeElliott Hughes  typedef CompileAssert<(bool(expr))> msg[bool(expr) ? 1 : -1] // NOLINT
45a5d5cfda6239d8876937e75eba43222f639d2447Carl Shapiro
466c21dc1bcafd83e90daa42a27dacd285278f3667Carl Shapiro// DISALLOW_COPY_AND_ASSIGN disallows the copy and operator= functions.
476c21dc1bcafd83e90daa42a27dacd285278f3667Carl Shapiro// It goes in the private: declarations in a class.
486c21dc1bcafd83e90daa42a27dacd285278f3667Carl Shapiro#define DISALLOW_COPY_AND_ASSIGN(TypeName) \
496c21dc1bcafd83e90daa42a27dacd285278f3667Carl Shapiro  TypeName(const TypeName&);               \
506c21dc1bcafd83e90daa42a27dacd285278f3667Carl Shapiro  void operator=(const TypeName&)
516c21dc1bcafd83e90daa42a27dacd285278f3667Carl Shapiro
526c21dc1bcafd83e90daa42a27dacd285278f3667Carl Shapiro// A macro to disallow all the implicit constructors, namely the
536c21dc1bcafd83e90daa42a27dacd285278f3667Carl Shapiro// default constructor, copy constructor and operator= functions.
546c21dc1bcafd83e90daa42a27dacd285278f3667Carl Shapiro//
556c21dc1bcafd83e90daa42a27dacd285278f3667Carl Shapiro// This should be used in the private: declarations for a class
566c21dc1bcafd83e90daa42a27dacd285278f3667Carl Shapiro// that wants to prevent anyone from instantiating it. This is
576c21dc1bcafd83e90daa42a27dacd285278f3667Carl Shapiro// especially useful for classes containing only static methods.
586c21dc1bcafd83e90daa42a27dacd285278f3667Carl Shapiro#define DISALLOW_IMPLICIT_CONSTRUCTORS(TypeName) \
596c21dc1bcafd83e90daa42a27dacd285278f3667Carl Shapiro  TypeName();                                    \
606c21dc1bcafd83e90daa42a27dacd285278f3667Carl Shapiro  DISALLOW_COPY_AND_ASSIGN(TypeName)
616c21dc1bcafd83e90daa42a27dacd285278f3667Carl Shapiro
62a2e18e1e77fc25c8260aad5daa267ababfcb65f6Carl Shapiro// The arraysize(arr) macro returns the # of elements in an array arr.
63a2e18e1e77fc25c8260aad5daa267ababfcb65f6Carl Shapiro// The expression is a compile-time constant, and therefore can be
64a2e18e1e77fc25c8260aad5daa267ababfcb65f6Carl Shapiro// used in defining new arrays, for example.  If you use arraysize on
65a2e18e1e77fc25c8260aad5daa267ababfcb65f6Carl Shapiro// a pointer by mistake, you will get a compile-time error.
66a2e18e1e77fc25c8260aad5daa267ababfcb65f6Carl Shapiro//
67a2e18e1e77fc25c8260aad5daa267ababfcb65f6Carl Shapiro// One caveat is that arraysize() doesn't accept any array of an
68a2e18e1e77fc25c8260aad5daa267ababfcb65f6Carl Shapiro// anonymous type or a type defined inside a function.  In these rare
69d2bdb57c9a3ceb5ac86060186cfe735a11f1e76eCarl Shapiro// cases, you have to use the unsafe ARRAYSIZE_UNSAFE() macro below.  This is
70a2e18e1e77fc25c8260aad5daa267ababfcb65f6Carl Shapiro// due to a limitation in C++'s template system.  The limitation might
71a2e18e1e77fc25c8260aad5daa267ababfcb65f6Carl Shapiro// eventually be removed, but it hasn't happened yet.
72a2e18e1e77fc25c8260aad5daa267ababfcb65f6Carl Shapiro
73a2e18e1e77fc25c8260aad5daa267ababfcb65f6Carl Shapiro// This template function declaration is used in defining arraysize.
74a2e18e1e77fc25c8260aad5daa267ababfcb65f6Carl Shapiro// Note that the function doesn't need an implementation, as we only
75a2e18e1e77fc25c8260aad5daa267ababfcb65f6Carl Shapiro// use its type.
76a2e18e1e77fc25c8260aad5daa267ababfcb65f6Carl Shapirotemplate <typename T, size_t N>
77a2e18e1e77fc25c8260aad5daa267ababfcb65f6Carl Shapirochar (&ArraySizeHelper(T (&array)[N]))[N];
78a2e18e1e77fc25c8260aad5daa267ababfcb65f6Carl Shapiro
79a2e18e1e77fc25c8260aad5daa267ababfcb65f6Carl Shapiro#define arraysize(array) (sizeof(ArraySizeHelper(array)))
80a2e18e1e77fc25c8260aad5daa267ababfcb65f6Carl Shapiro
81d2bdb57c9a3ceb5ac86060186cfe735a11f1e76eCarl Shapiro// ARRAYSIZE_UNSAFE performs essentially the same calculation as arraysize,
82d2bdb57c9a3ceb5ac86060186cfe735a11f1e76eCarl Shapiro// but can be used on anonymous types or types defined inside
83d2bdb57c9a3ceb5ac86060186cfe735a11f1e76eCarl Shapiro// functions.  It's less safe than arraysize as it accepts some
84d2bdb57c9a3ceb5ac86060186cfe735a11f1e76eCarl Shapiro// (although not all) pointers.  Therefore, you should use arraysize
85d2bdb57c9a3ceb5ac86060186cfe735a11f1e76eCarl Shapiro// whenever possible.
86d2bdb57c9a3ceb5ac86060186cfe735a11f1e76eCarl Shapiro//
87d2bdb57c9a3ceb5ac86060186cfe735a11f1e76eCarl Shapiro// The expression ARRAYSIZE_UNSAFE(a) is a compile-time constant of type
88d2bdb57c9a3ceb5ac86060186cfe735a11f1e76eCarl Shapiro// size_t.
89d2bdb57c9a3ceb5ac86060186cfe735a11f1e76eCarl Shapiro//
90d2bdb57c9a3ceb5ac86060186cfe735a11f1e76eCarl Shapiro// ARRAYSIZE_UNSAFE catches a few type errors.  If you see a compiler error
91d2bdb57c9a3ceb5ac86060186cfe735a11f1e76eCarl Shapiro//
92d2bdb57c9a3ceb5ac86060186cfe735a11f1e76eCarl Shapiro//   "warning: division by zero in ..."
93d2bdb57c9a3ceb5ac86060186cfe735a11f1e76eCarl Shapiro//
94d2bdb57c9a3ceb5ac86060186cfe735a11f1e76eCarl Shapiro// when using ARRAYSIZE_UNSAFE, you are (wrongfully) giving it a pointer.
95d2bdb57c9a3ceb5ac86060186cfe735a11f1e76eCarl Shapiro// You should only use ARRAYSIZE_UNSAFE on statically allocated arrays.
96d2bdb57c9a3ceb5ac86060186cfe735a11f1e76eCarl Shapiro//
97d2bdb57c9a3ceb5ac86060186cfe735a11f1e76eCarl Shapiro// The following comments are on the implementation details, and can
98d2bdb57c9a3ceb5ac86060186cfe735a11f1e76eCarl Shapiro// be ignored by the users.
99d2bdb57c9a3ceb5ac86060186cfe735a11f1e76eCarl Shapiro//
100d2bdb57c9a3ceb5ac86060186cfe735a11f1e76eCarl Shapiro// ARRAYSIZE_UNSAFE(arr) works by inspecting sizeof(arr) (the # of bytes in
101d2bdb57c9a3ceb5ac86060186cfe735a11f1e76eCarl Shapiro// the array) and sizeof(*(arr)) (the # of bytes in one array
102d2bdb57c9a3ceb5ac86060186cfe735a11f1e76eCarl Shapiro// element).  If the former is divisible by the latter, perhaps arr is
103d2bdb57c9a3ceb5ac86060186cfe735a11f1e76eCarl Shapiro// indeed an array, in which case the division result is the # of
104d2bdb57c9a3ceb5ac86060186cfe735a11f1e76eCarl Shapiro// elements in the array.  Otherwise, arr cannot possibly be an array,
105d2bdb57c9a3ceb5ac86060186cfe735a11f1e76eCarl Shapiro// and we generate a compiler error to prevent the code from
106d2bdb57c9a3ceb5ac86060186cfe735a11f1e76eCarl Shapiro// compiling.
107d2bdb57c9a3ceb5ac86060186cfe735a11f1e76eCarl Shapiro//
108d2bdb57c9a3ceb5ac86060186cfe735a11f1e76eCarl Shapiro// Since the size of bool is implementation-defined, we need to cast
109d2bdb57c9a3ceb5ac86060186cfe735a11f1e76eCarl Shapiro// !(sizeof(a) & sizeof(*(a))) to size_t in order to ensure the final
110d2bdb57c9a3ceb5ac86060186cfe735a11f1e76eCarl Shapiro// result has type size_t.
111d2bdb57c9a3ceb5ac86060186cfe735a11f1e76eCarl Shapiro//
112d2bdb57c9a3ceb5ac86060186cfe735a11f1e76eCarl Shapiro// This macro is not perfect as it wrongfully accepts certain
113d2bdb57c9a3ceb5ac86060186cfe735a11f1e76eCarl Shapiro// pointers, namely where the pointer size is divisible by the pointee
114d2bdb57c9a3ceb5ac86060186cfe735a11f1e76eCarl Shapiro// size.  Since all our code has to go through a 32-bit compiler,
115d2bdb57c9a3ceb5ac86060186cfe735a11f1e76eCarl Shapiro// where a pointer is 4 bytes, this means all pointers to a type whose
116d2bdb57c9a3ceb5ac86060186cfe735a11f1e76eCarl Shapiro// size is 3 or greater than 4 will be (righteously) rejected.
117d2bdb57c9a3ceb5ac86060186cfe735a11f1e76eCarl Shapiro#define ARRAYSIZE_UNSAFE(a) \
118362f9bc807169bcfc8761dde067bbfb79b5ad0fdElliott Hughes  ((sizeof(a) / sizeof(*(a))) / static_cast<size_t>(!(sizeof(a) % sizeof(*(a)))))
119d2bdb57c9a3ceb5ac86060186cfe735a11f1e76eCarl Shapiro
120ff17f1fd3ff32f93e45588eb2b158832d73f9afaElliott Hughes#define SIZEOF_MEMBER(t, f) sizeof((reinterpret_cast<t*>(4096))->f)
12159e85cd3c415ca483318bd7e4d5e743253b64685Carl Shapiro
122362f9bc807169bcfc8761dde067bbfb79b5ad0fdElliott Hughes#define OFFSETOF_MEMBER(t, f) \
1238a01a3a8caee37d4c4cf1a8c673f897c74aaf785Ian Rogers  (reinterpret_cast<const char*>(&reinterpret_cast<t*>(16)->f) - reinterpret_cast<const char*>(16)) // NOLINT
12459e85cd3c415ca483318bd7e4d5e743253b64685Carl Shapiro
12593e74e8d879270071c3aa163f8495ada8d21f42fElliott Hughes#define OFFSETOF_VOLATILE_MEMBER(t, f) \
126398f64b5805246765b699839b439e18c0dfbf2eeElliott Hughes  (reinterpret_cast<volatile char*>(&reinterpret_cast<t*>(16)->f) - reinterpret_cast<volatile char*>(16)) // NOLINT
12793e74e8d879270071c3aa163f8495ada8d21f42fElliott Hughes
128b1eba213afaf7fa6445de863ddc9680ab99762eaBrian Carlstrom#define PACKED(x) __attribute__ ((__aligned__(x), __packed__))
12985d1545e985ac689db4bad7849880e843707c862Elliott Hughes
130ff17f1fd3ff32f93e45588eb2b158832d73f9afaElliott Hughes#define LIKELY(x)       __builtin_expect((x), true)
131ff17f1fd3ff32f93e45588eb2b158832d73f9afaElliott Hughes#define UNLIKELY(x)     __builtin_expect((x), false)
132caab8c4ef372db5c119bfac1911fa27b174a935cIan Rogers
133e8ae0dcbbaed4681a56edb38d2a7976a444b1795Ian Rogers#ifndef NDEBUG
1341ffa32f0be7becec4907b26ead353e4b17e1219cIan Rogers#define ALWAYS_INLINE
1351ffa32f0be7becec4907b26ead353e4b17e1219cIan Rogers#else
136e8ae0dcbbaed4681a56edb38d2a7976a444b1795Ian Rogers#define ALWAYS_INLINE  __attribute__ ((always_inline))
1371ffa32f0be7becec4907b26ead353e4b17e1219cIan Rogers#endif
1381ffa32f0be7becec4907b26ead353e4b17e1219cIan Rogers
13963937db1cec24d065e2b4cdb7a41809528b5085bAnwar Ghuloum#if defined (__APPLE__)
1401d9314c989114f330297d52dae3fe0cd4848b183Anwar Ghuloum#define HOT_ATTR
14163937db1cec24d065e2b4cdb7a41809528b5085bAnwar Ghuloum#else
1421d9314c989114f330297d52dae3fe0cd4848b183Anwar Ghuloum#define HOT_ATTR __attribute__ ((hot))
14363937db1cec24d065e2b4cdb7a41809528b5085bAnwar Ghuloum#endif
14463937db1cec24d065e2b4cdb7a41809528b5085bAnwar Ghuloum
14596faf5b363d922ae91cf25404dee0e87c740c7c5Ian Rogers#define PURE __attribute__ ((__pure__))
14696faf5b363d922ae91cf25404dee0e87c740c7c5Ian Rogers
14774787a3fdb1b4901bbc9abd0eb4c055b8c8c8ecdElliott Hughes// bionic and glibc both have TEMP_FAILURE_RETRY, but Mac OS' libc doesn't.
14874787a3fdb1b4901bbc9abd0eb4c055b8c8c8ecdElliott Hughes#ifndef TEMP_FAILURE_RETRY
14974787a3fdb1b4901bbc9abd0eb4c055b8c8c8ecdElliott Hughes#define TEMP_FAILURE_RETRY(exp) ({ \
150398f64b5805246765b699839b439e18c0dfbf2eeElliott Hughes  typeof(exp) _rc; \
15174787a3fdb1b4901bbc9abd0eb4c055b8c8c8ecdElliott Hughes  do { \
15274787a3fdb1b4901bbc9abd0eb4c055b8c8c8ecdElliott Hughes    _rc = (exp); \
15374787a3fdb1b4901bbc9abd0eb4c055b8c8c8ecdElliott Hughes  } while (_rc == -1 && errno == EINTR); \
15474787a3fdb1b4901bbc9abd0eb4c055b8c8c8ecdElliott Hughes  _rc; })
15574787a3fdb1b4901bbc9abd0eb4c055b8c8c8ecdElliott Hughes#endif
15674787a3fdb1b4901bbc9abd0eb4c055b8c8c8ecdElliott Hughes
157c151f90d7e31a59675e118c5aff20c8d3ad50ad0Elliott Hughestemplate<typename T> void UNUSED(const T&) {}
158c151f90d7e31a59675e118c5aff20c8d3ad50ad0Elliott Hughes
159f8349361a16a4e2796efe9f3586b994e8d4834e4Elliott Hughes#if defined(__SUPPORT_TS_ANNOTATION__)
160f8349361a16a4e2796efe9f3586b994e8d4834e4Elliott Hughes
161f8349361a16a4e2796efe9f3586b994e8d4834e4Elliott Hughes#define ACQUIRED_AFTER(...) __attribute__ ((acquired_after(__VA_ARGS__)))
162f8349361a16a4e2796efe9f3586b994e8d4834e4Elliott Hughes#define ACQUIRED_BEFORE(...) __attribute__ ((acquired_before(__VA_ARGS__)))
163f8349361a16a4e2796efe9f3586b994e8d4834e4Elliott Hughes#define EXCLUSIVE_LOCK_FUNCTION(...) __attribute__ ((exclusive_lock(__VA_ARGS__)))
164f8349361a16a4e2796efe9f3586b994e8d4834e4Elliott Hughes#define EXCLUSIVE_LOCKS_REQUIRED(...) __attribute__ ((exclusive_locks_required(__VA_ARGS__)))
165f8349361a16a4e2796efe9f3586b994e8d4834e4Elliott Hughes#define EXCLUSIVE_TRYLOCK_FUNCTION(...) __attribute__ ((exclusive_trylock(__VA_ARGS__)))
166f8349361a16a4e2796efe9f3586b994e8d4834e4Elliott Hughes#define GUARDED_BY(x) __attribute__ ((guarded_by(x)))
167f8349361a16a4e2796efe9f3586b994e8d4834e4Elliott Hughes#define GUARDED_VAR __attribute__ ((guarded))
168f8349361a16a4e2796efe9f3586b994e8d4834e4Elliott Hughes#define LOCKABLE __attribute__ ((lockable))
169f8349361a16a4e2796efe9f3586b994e8d4834e4Elliott Hughes#define LOCK_RETURNED(x) __attribute__ ((lock_returned(x)))
170f8349361a16a4e2796efe9f3586b994e8d4834e4Elliott Hughes#define LOCKS_EXCLUDED(...) __attribute__ ((locks_excluded(__VA_ARGS__)))
171f8349361a16a4e2796efe9f3586b994e8d4834e4Elliott Hughes#define NO_THREAD_SAFETY_ANALYSIS __attribute__ ((no_thread_safety_analysis))
172f8349361a16a4e2796efe9f3586b994e8d4834e4Elliott Hughes#define PT_GUARDED_BY(x) __attribute__ ((point_to_guarded_by(x)))
173f8349361a16a4e2796efe9f3586b994e8d4834e4Elliott Hughes#define PT_GUARDED_VAR __attribute__ ((point_to_guarded))
174f8349361a16a4e2796efe9f3586b994e8d4834e4Elliott Hughes#define SCOPED_LOCKABLE __attribute__ ((scoped_lockable))
175f8349361a16a4e2796efe9f3586b994e8d4834e4Elliott Hughes#define SHARED_LOCK_FUNCTION(...) __attribute__ ((shared_lock(__VA_ARGS__)))
176f8349361a16a4e2796efe9f3586b994e8d4834e4Elliott Hughes#define SHARED_LOCKS_REQUIRED(...) __attribute__ ((shared_locks_required(__VA_ARGS__)))
177f8349361a16a4e2796efe9f3586b994e8d4834e4Elliott Hughes#define SHARED_TRYLOCK_FUNCTION(...) __attribute__ ((shared_trylock(__VA_ARGS__)))
178f8349361a16a4e2796efe9f3586b994e8d4834e4Elliott Hughes#define UNLOCK_FUNCTION(...) __attribute__ ((unlock(__VA_ARGS__)))
179f8349361a16a4e2796efe9f3586b994e8d4834e4Elliott Hughes
180f8349361a16a4e2796efe9f3586b994e8d4834e4Elliott Hughes#else
181f8349361a16a4e2796efe9f3586b994e8d4834e4Elliott Hughes
182f8349361a16a4e2796efe9f3586b994e8d4834e4Elliott Hughes#define ACQUIRED_AFTER(...)
183f8349361a16a4e2796efe9f3586b994e8d4834e4Elliott Hughes#define ACQUIRED_BEFORE(...)
184f8349361a16a4e2796efe9f3586b994e8d4834e4Elliott Hughes#define EXCLUSIVE_LOCK_FUNCTION(...)
185f8349361a16a4e2796efe9f3586b994e8d4834e4Elliott Hughes#define EXCLUSIVE_LOCKS_REQUIRED(...)
186f8349361a16a4e2796efe9f3586b994e8d4834e4Elliott Hughes#define EXCLUSIVE_TRYLOCK_FUNCTION(...)
187f8349361a16a4e2796efe9f3586b994e8d4834e4Elliott Hughes#define GUARDED_BY(x)
188f8349361a16a4e2796efe9f3586b994e8d4834e4Elliott Hughes#define GUARDED_VAR
189f8349361a16a4e2796efe9f3586b994e8d4834e4Elliott Hughes#define LOCKABLE
190f8349361a16a4e2796efe9f3586b994e8d4834e4Elliott Hughes#define LOCK_RETURNED(x)
191f8349361a16a4e2796efe9f3586b994e8d4834e4Elliott Hughes#define LOCKS_EXCLUDED(...)
192f8349361a16a4e2796efe9f3586b994e8d4834e4Elliott Hughes#define NO_THREAD_SAFETY_ANALYSIS
193f8349361a16a4e2796efe9f3586b994e8d4834e4Elliott Hughes#define PT_GUARDED_BY(x)
194f8349361a16a4e2796efe9f3586b994e8d4834e4Elliott Hughes#define PT_GUARDED_VAR
195f8349361a16a4e2796efe9f3586b994e8d4834e4Elliott Hughes#define SCOPED_LOCKABLE
196f8349361a16a4e2796efe9f3586b994e8d4834e4Elliott Hughes#define SHARED_LOCK_FUNCTION(...)
197f8349361a16a4e2796efe9f3586b994e8d4834e4Elliott Hughes#define SHARED_LOCKS_REQUIRED(...)
198f8349361a16a4e2796efe9f3586b994e8d4834e4Elliott Hughes#define SHARED_TRYLOCK_FUNCTION(...)
199f8349361a16a4e2796efe9f3586b994e8d4834e4Elliott Hughes#define UNLOCK_FUNCTION(...)
200f8349361a16a4e2796efe9f3586b994e8d4834e4Elliott Hughes
2017934ac288acfb2552bb0b06ec1f61e5820d924a4Brian Carlstrom#endif  // defined(__SUPPORT_TS_ANNOTATION__)
202f8349361a16a4e2796efe9f3586b994e8d4834e4Elliott Hughes
203fc0e3219edc9a5bf81b166e82fd5db2796eb6a0dBrian Carlstrom#endif  // ART_RUNTIME_BASE_MACROS_H_
204