< prev index next >
src/share/vm/utilities/globalDefinitions.hpp
Print this page
*** 1252,1261 ****
--- 1252,1268 ----
// "to" should be greater than "from."
inline intx byte_size(void* from, void* to) {
return (address)to - (address)from;
}
+ template <class T>
+ void swap(T& a, T& b) {
+ T t(a);
+ a = b;
+ b = t;
+ }
+
//----------------------------------------------------------------------------------------------------
// Avoid non-portable casts with these routines (DEPRECATED)
// NOTE: USE Bytes class INSTEAD WHERE POSSIBLE
// Bytes is optimized machine-specifically and may be much faster then the portable routines below.
< prev index next >