equal
deleted
inserted
replaced
1 /* |
1 /* |
2 * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. |
2 * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 * |
4 * |
5 * This code is free software; you can redistribute it and/or modify it |
5 * This code is free software; you can redistribute it and/or modify it |
6 * under the terms of the GNU General Public License version 2 only, as |
6 * under the terms of the GNU General Public License version 2 only, as |
7 * published by the Free Software Foundation. |
7 * published by the Free Software Foundation. |
2944 if (res == NULL) { |
2944 if (res == NULL) { |
2945 warning("NUMA page allocation failed"); |
2945 warning("NUMA page allocation failed"); |
2946 } |
2946 } |
2947 if( Verbose && PrintMiscellaneous ) { |
2947 if( Verbose && PrintMiscellaneous ) { |
2948 reserveTimer.stop(); |
2948 reserveTimer.stop(); |
2949 tty->print_cr("reserve_memory of %Ix bytes took %ld ms (%ld ticks)", bytes, |
2949 tty->print_cr("reserve_memory of %Ix bytes took " JLONG_FORMAT " ms (" JLONG_FORMAT " ticks)", bytes, |
2950 reserveTimer.milliseconds(), reserveTimer.ticks()); |
2950 reserveTimer.milliseconds(), reserveTimer.ticks()); |
2951 } |
2951 } |
2952 } |
2952 } |
2953 assert(res == NULL || addr == NULL || addr == res, |
2953 assert(res == NULL || addr == NULL || addr == res, |
2954 "Unexpected address from reserve."); |
2954 "Unexpected address from reserve."); |
4303 hFile = CreateFile(file_name, GENERIC_READ, FILE_SHARE_READ, NULL, |
4303 hFile = CreateFile(file_name, GENERIC_READ, FILE_SHARE_READ, NULL, |
4304 OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL); |
4304 OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL); |
4305 if (hFile == NULL) { |
4305 if (hFile == NULL) { |
4306 if (PrintMiscellaneous && Verbose) { |
4306 if (PrintMiscellaneous && Verbose) { |
4307 DWORD err = GetLastError(); |
4307 DWORD err = GetLastError(); |
4308 tty->print_cr("CreateFile() failed: GetLastError->%ld."); |
4308 tty->print_cr("CreateFile() failed: GetLastError->%ld.", err); |
4309 } |
4309 } |
4310 return NULL; |
4310 return NULL; |
4311 } |
4311 } |
4312 |
4312 |
4313 if (allow_exec) { |
4313 if (allow_exec) { |
4353 HANDLE hMap = CreateFileMapping(hFile, NULL, PAGE_WRITECOPY, 0, 0, |
4353 HANDLE hMap = CreateFileMapping(hFile, NULL, PAGE_WRITECOPY, 0, 0, |
4354 NULL /*file_name*/); |
4354 NULL /*file_name*/); |
4355 if (hMap == NULL) { |
4355 if (hMap == NULL) { |
4356 if (PrintMiscellaneous && Verbose) { |
4356 if (PrintMiscellaneous && Verbose) { |
4357 DWORD err = GetLastError(); |
4357 DWORD err = GetLastError(); |
4358 tty->print_cr("CreateFileMapping() failed: GetLastError->%ld."); |
4358 tty->print_cr("CreateFileMapping() failed: GetLastError->%ld.", err); |
4359 } |
4359 } |
4360 CloseHandle(hFile); |
4360 CloseHandle(hFile); |
4361 return NULL; |
4361 return NULL; |
4362 } |
4362 } |
4363 |
4363 |