< prev index next >

src/share/vm/runtime/os.cpp

Print this page
rev 11647 : 8161258: Simplify including platform files.
Summary: Include patform files with macros cpu_header() etc. Do various cleanups of macro usages. Remove _64/_32 from adlc generated files and platform .hpp files. Merge stubRoutines_x86*.hpp. Remove empty mutex_<os>* files.
Reviewed-by: dholmes, coleenp, kbarrett


1725   if (MemTracker::tracking_level() > NMT_minimal) {
1726     Tracker tkr = MemTracker::get_virtual_memory_release_tracker();
1727     result = pd_unmap_memory(addr, bytes);
1728     if (result) {
1729       tkr.record((address)addr, bytes);
1730     }
1731   } else {
1732     result = pd_unmap_memory(addr, bytes);
1733   }
1734   return result;
1735 }
1736 
1737 void os::free_memory(char *addr, size_t bytes, size_t alignment_hint) {
1738   pd_free_memory(addr, bytes, alignment_hint);
1739 }
1740 
1741 void os::realign_memory(char *addr, size_t bytes, size_t alignment_hint) {
1742   pd_realign_memory(addr, bytes, alignment_hint);
1743 }
1744 
1745 #ifndef TARGET_OS_FAMILY_windows
1746 /* try to switch state from state "from" to state "to"
1747  * returns the state set after the method is complete
1748  */
1749 os::SuspendResume::State os::SuspendResume::switch_state(os::SuspendResume::State from,
1750                                                          os::SuspendResume::State to)
1751 {
1752   os::SuspendResume::State result =
1753     (os::SuspendResume::State) Atomic::cmpxchg((jint) to, (jint *) &_state, (jint) from);
1754   if (result == from) {
1755     // success
1756     return to;
1757   }
1758   return result;
1759 }
1760 #endif
1761 
1762 /////////////// Unit tests ///////////////
1763 
1764 #ifndef PRODUCT
1765 




1725   if (MemTracker::tracking_level() > NMT_minimal) {
1726     Tracker tkr = MemTracker::get_virtual_memory_release_tracker();
1727     result = pd_unmap_memory(addr, bytes);
1728     if (result) {
1729       tkr.record((address)addr, bytes);
1730     }
1731   } else {
1732     result = pd_unmap_memory(addr, bytes);
1733   }
1734   return result;
1735 }
1736 
1737 void os::free_memory(char *addr, size_t bytes, size_t alignment_hint) {
1738   pd_free_memory(addr, bytes, alignment_hint);
1739 }
1740 
1741 void os::realign_memory(char *addr, size_t bytes, size_t alignment_hint) {
1742   pd_realign_memory(addr, bytes, alignment_hint);
1743 }
1744 
1745 #ifndef _WINDOWS
1746 /* try to switch state from state "from" to state "to"
1747  * returns the state set after the method is complete
1748  */
1749 os::SuspendResume::State os::SuspendResume::switch_state(os::SuspendResume::State from,
1750                                                          os::SuspendResume::State to)
1751 {
1752   os::SuspendResume::State result =
1753     (os::SuspendResume::State) Atomic::cmpxchg((jint) to, (jint *) &_state, (jint) from);
1754   if (result == from) {
1755     // success
1756     return to;
1757   }
1758   return result;
1759 }
1760 #endif
1761 
1762 /////////////// Unit tests ///////////////
1763 
1764 #ifndef PRODUCT
1765 


< prev index next >