9 * This code is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12 * version 2 for more details (a copy is included in the LICENSE file that
13 * accompanied this code).
14 *
15 * You should have received a copy of the GNU General Public License version
16 * 2 along with this work; if not, write to the Free Software Foundation,
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 *
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 *
23 */
24
25 #include "memory/allocation.inline.hpp"
26 #include "oops/constantPool.hpp"
27 #include "oops/method.hpp"
28 #include "oops/oop.inline.hpp"
29 #include "runtime/handles.inline.hpp"
30 #include "runtime/javaThread.hpp"
31
32 #ifdef ASSERT
33 #define assert_handle_mark_nesting() \
34 assert(_handle_mark_nesting > 1, "memory leak: allocating handle outside HandleMark"); \
35 assert(_no_handle_mark_nesting == 0, "allocating handle inside NoHandleMark"); \
36
37
38 oop* HandleArea::allocate_handle(oop obj) {
39 assert_handle_mark_nesting();
40 assert(oopDesc::is_oop(obj), "not an oop: " INTPTR_FORMAT, p2i(obj));
41 return real_allocate_handle(obj);
42 }
43
44 oop* HandleArea::allocate_null_handle() {
45 assert_handle_mark_nesting();
46 return real_allocate_handle(nullptr);
47 }
48 #endif
|
9 * This code is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12 * version 2 for more details (a copy is included in the LICENSE file that
13 * accompanied this code).
14 *
15 * You should have received a copy of the GNU General Public License version
16 * 2 along with this work; if not, write to the Free Software Foundation,
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 *
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 *
23 */
24
25 #include "memory/allocation.inline.hpp"
26 #include "oops/constantPool.hpp"
27 #include "oops/method.hpp"
28 #include "oops/oop.inline.hpp"
29 #include "oops/inlineKlass.hpp"
30 #include "runtime/atomic.hpp"
31 #include "runtime/handles.inline.hpp"
32 #include "runtime/javaThread.hpp"
33
34 #ifdef ASSERT
35 #define assert_handle_mark_nesting() \
36 assert(_handle_mark_nesting > 1, "memory leak: allocating handle outside HandleMark"); \
37 assert(_no_handle_mark_nesting == 0, "allocating handle inside NoHandleMark"); \
38
39
40 oop* HandleArea::allocate_handle(oop obj) {
41 assert_handle_mark_nesting();
42 assert(oopDesc::is_oop(obj), "not an oop: " INTPTR_FORMAT, p2i(obj));
43 return real_allocate_handle(obj);
44 }
45
46 oop* HandleArea::allocate_null_handle() {
47 assert_handle_mark_nesting();
48 return real_allocate_handle(nullptr);
49 }
50 #endif
|