Top


定義場所(file name)

hotspot/src/share/vm/gc_implementation/parNew/parGCAllocBuffer.hpp

説明(description)

  // If an allocation of the given "word_sz" can be satisfied within the
  // buffer, do the allocation, returning a pointer to the start of the
  // allocated block.  If the allocation request cannot be satisfied,
  // return NULL.

名前(function name)

  HeapWord* allocate(size_t word_sz) {

本体部(body)

  {- -------------------------------------------
  (1) word_sz 引数分だけ _top をずらして領域を確保し, その領域をリターンする.
      ただし, 空き領域 (_top と _end の間の領域) が word_sz に満たない場合は NULL をリターンする.
      ---------------------------------------- -}

        HeapWord* res = _top;
        if (pointer_delta(_end, _top) >= word_sz) {
          _top = _top + word_sz;
          return res;
        } else {
          return NULL;
        }
      }

This document is available under the GNU GENERAL PUBLIC LICENSE Version 2.