hotspot/src/share/vm/gc_interface/collectedHeap.inline.hpp
oop CollectedHeap::array_allocate(KlassHandle klass,
int size,
int length,
TRAPS) {
{- -------------------------------------------
(1) (assert)
---------------------------------------- -}
debug_only(check_for_valid_allocation_state());
assert(!Universe::heap()->is_gc_active(), "Allocation during gc not allowed");
assert(size >= 0, "int won't convert to size_t");
{- -------------------------------------------
(1) CollectedHeap::common_mem_allocate_init() でメモリを確保する
---------------------------------------- -}
HeapWord* obj = common_mem_allocate_init(size, false, CHECK_NULL);
{- -------------------------------------------
(1) CollectedHeap::post_allocation_setup_array() で確保したメモリのヘッダー部分を初期化する
(mark フィールド, klass フィールド, length フィールド)
(また, JVMTI や DTrace, JMM のフック点でもある)
---------------------------------------- -}
post_allocation_setup_array(klass, obj, size, length);
{- -------------------------------------------
(1) (assert)
---------------------------------------- -}
NOT_PRODUCT(Universe::heap()->check_for_bad_heap_word_value(obj, size));
{- -------------------------------------------
(1) 結果をリターン
---------------------------------------- -}
return (oop)obj;
}
This document is available under the GNU GENERAL PUBLIC LICENSE Version 2.