当前位置: 首页>>代码示例>>C++>>正文


C++ MemRegion::byte_size方法代码示例

本文整理汇总了C++中MemRegion::byte_size方法的典型用法代码示例。如果您正苦于以下问题:C++ MemRegion::byte_size方法的具体用法?C++ MemRegion::byte_size怎么用?C++ MemRegion::byte_size使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在MemRegion的用法示例。


在下文中一共展示了MemRegion::byte_size方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: write_string_regions

// Write the string space. The string space contains one or multiple GC(G1) regions.
// When the total string space size is smaller than one GC region of the dump time,
// only one string region is used for shared strings.
//
// If the total string space size is bigger than one GC region, there would be more
// than one GC regions allocated for shared strings. The first/bottom GC region might
// be a partial GC region with the empty portion at the higher address within that region.
// The non-empty portion of the first region is written into the archive as one string
// region. The rest are consecutive full GC regions if they exist, which can be written
// out in one chunk as another string region.
void FileMapInfo::write_string_regions(GrowableArray<MemRegion> *regions) {
  for (int i = MetaspaceShared::first_string;
           i < MetaspaceShared::first_string + MetaspaceShared::max_strings; i++) {
    char* start = NULL;
    size_t size = 0;
    if (regions->is_nonempty()) {
      if (i == MetaspaceShared::first_string) {
        MemRegion first = regions->first();
        start = (char*)first.start();
        size = first.byte_size();
      } else {
        int len = regions->length();
        if (len > 1) {
          start = (char*)regions->at(1).start();
          size = (char*)regions->at(len - 1).end() - start;
        }
      }
    }
    write_region(i, start, size, size, false, false);
  }
}
开发者ID:benbenolson,项目名称:hotspot_9_mc,代码行数:31,代码来源:filemap.cpp

示例2: clear

void CardTableRS::clear(MemRegion mr) {
  for (int i = 0; i < _ct_bs._cur_covered_regions; i++) {
    MemRegion mri = mr.intersection(_ct_bs._covered[i]);
    if (mri.byte_size() > 0) clear_MemRegion(mri);
  }
}
开发者ID:fatman2021,项目名称:myforthprocessor,代码行数:6,代码来源:cardTableRS.cpp


注:本文中的MemRegion::byte_size方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。