本文整理汇总了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);
}
}
示例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);
}
}