src/share/vm/runtime/os.cpp

Print this page
rev 4525 : 8014611: reserve_and_align() assumptions are invalid on windows
Summary: also reviewed by ron.durbin@oracle.com, thomas.schatzl@oracle.com
Reviewed-by: dcubed, brutisso


1444   }
1445   return res;
1446 }
1447 
1448 bool os::uncommit_memory(char* addr, size_t bytes) {
1449   bool res = pd_uncommit_memory(addr, bytes);
1450   if (res) {
1451     MemTracker::record_virtual_memory_uncommit((address)addr, bytes);
1452   }
1453   return res;
1454 }
1455 
1456 bool os::release_memory(char* addr, size_t bytes) {
1457   bool res = pd_release_memory(addr, bytes);
1458   if (res) {
1459     MemTracker::record_virtual_memory_release((address)addr, bytes);
1460   }
1461   return res;
1462 }
1463 






1464 
1465 char* os::map_memory(int fd, const char* file_name, size_t file_offset,
1466                            char *addr, size_t bytes, bool read_only,
1467                            bool allow_exec) {
1468   char* result = pd_map_memory(fd, file_name, file_offset, addr, bytes, read_only, allow_exec);
1469   if (result != NULL) {
1470     MemTracker::record_virtual_memory_reserve((address)result, bytes, CALLER_PC);
1471     MemTracker::record_virtual_memory_commit((address)result, bytes, CALLER_PC);
1472   }
1473   return result;
1474 }
1475 
1476 char* os::remap_memory(int fd, const char* file_name, size_t file_offset,
1477                              char *addr, size_t bytes, bool read_only,
1478                              bool allow_exec) {
1479   return pd_remap_memory(fd, file_name, file_offset, addr, bytes,
1480                     read_only, allow_exec);
1481 }
1482 
1483 bool os::unmap_memory(char *addr, size_t bytes) {


1444   }
1445   return res;
1446 }
1447 
1448 bool os::uncommit_memory(char* addr, size_t bytes) {
1449   bool res = pd_uncommit_memory(addr, bytes);
1450   if (res) {
1451     MemTracker::record_virtual_memory_uncommit((address)addr, bytes);
1452   }
1453   return res;
1454 }
1455 
1456 bool os::release_memory(char* addr, size_t bytes) {
1457   bool res = pd_release_memory(addr, bytes);
1458   if (res) {
1459     MemTracker::record_virtual_memory_release((address)addr, bytes);
1460   }
1461   return res;
1462 }
1463 
1464 bool os::release_or_uncommit_partial_region(char * addr, size_t bytes) {
1465   if (can_release_partial_region()) {
1466     return release_memory(addr, bytes);
1467   }
1468   return uncommit_memory(addr, bytes);
1469 }
1470 
1471 char* os::map_memory(int fd, const char* file_name, size_t file_offset,
1472                            char *addr, size_t bytes, bool read_only,
1473                            bool allow_exec) {
1474   char* result = pd_map_memory(fd, file_name, file_offset, addr, bytes, read_only, allow_exec);
1475   if (result != NULL) {
1476     MemTracker::record_virtual_memory_reserve((address)result, bytes, CALLER_PC);
1477     MemTracker::record_virtual_memory_commit((address)result, bytes, CALLER_PC);
1478   }
1479   return result;
1480 }
1481 
1482 char* os::remap_memory(int fd, const char* file_name, size_t file_offset,
1483                              char *addr, size_t bytes, bool read_only,
1484                              bool allow_exec) {
1485   return pd_remap_memory(fd, file_name, file_offset, addr, bytes,
1486                     read_only, allow_exec);
1487 }
1488 
1489 bool os::unmap_memory(char *addr, size_t bytes) {