3375 // alignment when doing symbol lookup. To work around this, we force early
3376 // binding of all symbols now, thus binding when alignment is known-good.
3377 _dyld_bind_fully_image_containing_address((const void *) &os::init);
3378 #endif
3379
3380 os::Posix::init();
3381 }
3382
3383 // To install functions for atexit system call
3384 extern "C" {
3385 static void perfMemory_exit_helper() {
3386 perfMemory_exit();
3387 }
3388 }
3389
3390 // this is called _after_ the global arguments have been parsed
3391 jint os::init_2(void) {
3392
3393 os::Posix::init_2();
3394
3395 // Allocate a single page and mark it as readable for safepoint polling
3396 address polling_page = (address) ::mmap(NULL, Bsd::page_size(), PROT_READ, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0);
3397 guarantee(polling_page != MAP_FAILED, "os::init_2: failed to allocate polling page");
3398
3399 os::set_polling_page(polling_page);
3400 log_info(os)("SafePoint Polling address: " INTPTR_FORMAT, p2i(polling_page));
3401
3402 if (!UseMembar) {
3403 address mem_serialize_page = (address) ::mmap(NULL, Bsd::page_size(), PROT_READ | PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0);
3404 guarantee(mem_serialize_page != MAP_FAILED, "mmap Failed for memory serialize page");
3405 os::set_memory_serialize_page(mem_serialize_page);
3406 log_info(os)("Memory Serialize Page address: " INTPTR_FORMAT, p2i(mem_serialize_page));
3407 }
3408
3409 // initialize suspend/resume support - must do this before signal_sets_init()
3410 if (SR_initialize() != 0) {
3411 perror("SR_initialize failed");
3412 return JNI_ERR;
3413 }
3414
3415 Bsd::signal_sets_init();
3416 Bsd::install_signal_handlers();
3417
3418 // Check and sets minimum stack sizes against command line options
3419 if (Posix::set_minimum_stack_sizes() == JNI_ERR) {
3420 return JNI_ERR;
3421 }
3422
3423 if (MaxFDLimit) {
3424 // set the number of file descriptors to max. print out error
3425 // if getrlimit/setrlimit fails but continue regardless.
3426 struct rlimit nbr_files;
3427 int status = getrlimit(RLIMIT_NOFILE, &nbr_files);
3428 if (status != 0) {
|
3375 // alignment when doing symbol lookup. To work around this, we force early
3376 // binding of all symbols now, thus binding when alignment is known-good.
3377 _dyld_bind_fully_image_containing_address((const void *) &os::init);
3378 #endif
3379
3380 os::Posix::init();
3381 }
3382
3383 // To install functions for atexit system call
3384 extern "C" {
3385 static void perfMemory_exit_helper() {
3386 perfMemory_exit();
3387 }
3388 }
3389
3390 // this is called _after_ the global arguments have been parsed
3391 jint os::init_2(void) {
3392
3393 os::Posix::init_2();
3394
3395 // initialize suspend/resume support - must do this before signal_sets_init()
3396 if (SR_initialize() != 0) {
3397 perror("SR_initialize failed");
3398 return JNI_ERR;
3399 }
3400
3401 Bsd::signal_sets_init();
3402 Bsd::install_signal_handlers();
3403
3404 // Check and sets minimum stack sizes against command line options
3405 if (Posix::set_minimum_stack_sizes() == JNI_ERR) {
3406 return JNI_ERR;
3407 }
3408
3409 if (MaxFDLimit) {
3410 // set the number of file descriptors to max. print out error
3411 // if getrlimit/setrlimit fails but continue regardless.
3412 struct rlimit nbr_files;
3413 int status = getrlimit(RLIMIT_NOFILE, &nbr_files);
3414 if (status != 0) {
|