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 #ifndef SHARE_GC_SHARED_COLLECTEDHEAP_INLINE_HPP
26 #define SHARE_GC_SHARED_COLLECTEDHEAP_INLINE_HPP
27
28 #include "gc/shared/collectedHeap.hpp"
29
30 #include "gc/shared/memAllocator.hpp"
31 #include "oops/oop.inline.hpp"
32 #include "utilities/align.hpp"
33
34 inline oop CollectedHeap::obj_allocate(Klass* klass, size_t size, TRAPS) {
35 ObjAllocator allocator(klass, size, THREAD);
36 return allocator.allocate();
37 }
38
39 inline oop CollectedHeap::array_allocate(Klass* klass, size_t size, int length, bool do_zero, TRAPS) {
40 ObjArrayAllocator allocator(klass, size, length, do_zero, THREAD);
41 return allocator.allocate();
42 }
43
44 inline oop CollectedHeap::class_allocate(Klass* klass, size_t size, TRAPS) {
45 ClassAllocator allocator(klass, size, THREAD);
46 return allocator.allocate();
47 }
48
49 #endif // SHARE_GC_SHARED_COLLECTEDHEAP_INLINE_HPP
|
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 #ifndef SHARE_GC_SHARED_COLLECTEDHEAP_INLINE_HPP
26 #define SHARE_GC_SHARED_COLLECTEDHEAP_INLINE_HPP
27
28 #include "gc/shared/collectedHeap.hpp"
29
30 #include "gc/shared/memAllocator.hpp"
31 #include "oops/oop.inline.hpp"
32 #include "utilities/align.hpp"
33
34 inline oop CollectedHeap::obj_allocate(Klass* klass, size_t size, TRAPS) {
35 ObjAllocator allocator(klass, size, THREAD);
36 return allocator.allocate();
37 }
38
39 inline oop CollectedHeap::obj_buffer_allocate(Klass* klass, size_t size, TRAPS) {
40 ObjBufferAllocator allocator(klass, size, THREAD);
41 return allocator.allocate();
42 }
43
44 inline oop CollectedHeap::array_allocate(Klass* klass, size_t size, int length, bool do_zero, TRAPS) {
45 assert(!klass->is_objArray_klass() || klass->is_refArray_klass() || klass->is_flatArray_klass(), "ObjArrayKlass must never be used to allocate array instances directly");
46 ObjArrayAllocator allocator(klass, size, length, do_zero, THREAD);
47 return allocator.allocate();
48 }
49
50 inline oop CollectedHeap::class_allocate(Klass* klass, size_t size, TRAPS) {
51 ClassAllocator allocator(klass, size, THREAD);
52 return allocator.allocate();
53 }
54
55 #endif // SHARE_GC_SHARED_COLLECTEDHEAP_INLINE_HPP
|