< prev index next >

src/share/vm/utilities/globalDefinitions.hpp

Print this page

        

*** 241,250 **** --- 241,280 ---- } else { return s; } } + inline const char* exact_unit_for_byte_size(size_t s) { + #ifdef _LP64 + if (s >= G && (s % G) == 0) { + return "G"; + } + #endif + if (s >= M && (s % M) == 0) { + return "M"; + } + if (s >= K && (s % K) == 0) { + return "K"; + } + return "B"; + } + + inline size_t byte_size_in_exact_unit(size_t s) { + #ifdef _LP64 + if (s >= G && (s % G) == 0) { + return s / G; + } + #endif + if (s >= M && (s % M) == 0) { + return s / M; + } + if (s >= K && (s % K) == 0) { + return s / K; + } + return s; + } + //---------------------------------------------------------------------------------------------------- // VM type definitions // intx and uintx are the 'extended' int and 'extended' unsigned int types; // they are 32bit wide on a 32-bit platform, and 64bit wide on a 64bit platform.
< prev index next >