本文整理汇总了C++中oop::is_shared方法的典型用法代码示例。如果您正苦于以下问题:C++ oop::is_shared方法的具体用法?C++ oop::is_shared怎么用?C++ oop::is_shared使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类oop
的用法示例。
在下文中一共展示了oop::is_shared方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: do_object
void do_object(oop obj) {
if (obj->is_shared()) {
return;
}
if (obj->is_gc_marked() && obj->forwardee() == NULL) {
int s = obj->size();
oop sh_obj = (oop)_space->allocate(s);
if (sh_obj == NULL) {
if (_read_only) {
warning("\nThe permanent generation read only space is not large "
"enough to \npreload requested classes. Use "
"-XX:SharedReadOnlySize= to increase \nthe initial "
"size of the read only space.\n");
} else {
warning("\nThe permanent generation read write space is not large "
"enough to \npreload requested classes. Use "
"-XX:SharedReadWriteSize= to increase \nthe initial "
"size of the read write space.\n");
}
exit(2);
}
if (PrintSharedSpaces && Verbose && WizardMode) {
tty->print_cr("\nMoveMarkedObjects: " PTR_FORMAT " -> " PTR_FORMAT " %s", obj, sh_obj,
(_read_only ? "ro" : "rw"));
}
Copy::aligned_disjoint_words((HeapWord*)obj, (HeapWord*)sh_obj, s);
obj->forward_to(sh_obj);
if (_read_only) {
// Readonly objects: set hash value to self pointer and make gc_marked.
sh_obj->forward_to(sh_obj);
} else {
sh_obj->init_mark();
}
}
}
示例2: mark_object
static bool mark_object(oop obj) {
if (obj != NULL &&
!obj->is_shared() &&
!obj->is_forwarded() &&
!obj->is_gc_marked()) {
obj->set_mark(markOopDesc::prototype()->set_marked());
return true;
}
return false;
}