本文整理汇总了C++中VM::get_properties方法的典型用法代码示例。如果您正苦于以下问题:C++ VM::get_properties方法的具体用法?C++ VM::get_properties怎么用?C++ VM::get_properties使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类VM
的用法示例。
在下文中一共展示了VM::get_properties方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: initialize
void HPI::initialize() // REMOVEME
{
TRACESUBSYSTEMINITIALIZATION("hpi_init");
// Load libhpi.so
VM* vm = VM::get_current();
Properties& properties = vm->get_properties();
const char* boot_library_path = properties.get("sun.boot.library.path");
// Use Buffer to assemble library path.
Buffer<> buf;
buf.write(boot_library_path);
buf.write("/native_threads/libhpi.so");
Utf8String u = buf.utf8_str();
if (opt_TraceHPI)
log_println("HPI::initialize: Loading HPI %s ", buf.c_str());
NativeLibrary nl(u);
void* handle = nl.open();
if (handle == NULL)
if (opt_TraceHPI)
os::abort("HPI::initialize: HPI open failed");
// Resolve the DLL_Initialize function from the library.
void* dll_initialize = os::dlsym(handle, "DLL_Initialize");
jint (JNICALL *DLL_Initialize)(GetInterfaceFunc*, void*);
DLL_Initialize = (jint (JNICALL *)(GetInterfaceFunc*, void*)) (uintptr_t) dll_initialize;
if (opt_TraceHPI && DLL_Initialize == NULL)
log_println("hpi_init: HPI dlsym of DLL_Initialize failed: %s", os::dlerror());
if (DLL_Initialize == NULL || (*DLL_Initialize)(&_get_interface, &callbacks) < 0) {
if (opt_TraceHPI)
vm_abort("hpi_init: HPI DLL_Initialize failed");
}
NativeLibraries& nls = vm->get_nativelibraries();
nls.add(nl);
if (opt_TraceHPI)
log_println("HPI::initialize: HPI loaded successfully");
// Resolve the interfaces.
/* NOTE: The intptr_t-case is only to prevent the a compiler
warning with -O2: warning: dereferencing type-punned pointer
will break strict-aliasing rules */
int result;
result = (*_get_interface)((void**) (uintptr_t) &_file, "File", 1);
if (result != 0)
os::abort("hpi_init: Can't find HPI_FileInterface");
result = (*_get_interface)((void**) (uintptr_t) &_library, "Library", 1);
if (result != 0)
os::abort("hpi_init: Can't find HPI_LibraryInterface");
result = (*_get_interface)((void**) (uintptr_t) &_system, "System", 1);
if (result != 0)
os::abort("hpi_init: Can't find HPI_SystemInterface");
}