22 */ 23 24 #ifndef SHARE_GC_Z_ZUTILS_HPP 25 #define SHARE_GC_Z_ZUTILS_HPP 26 27 #include "memory/allocation.hpp" 28 29 class ZUtils : public AllStatic { 30 public: 31 // Allocation 32 static uintptr_t alloc_aligned(size_t alignment, size_t size); 33 34 // Power of two 35 static size_t round_up_power_of_2(size_t value); 36 static size_t round_down_power_of_2(size_t value); 37 38 // Size conversion 39 static size_t bytes_to_words(size_t size_in_words); 40 static size_t words_to_bytes(size_t size_in_words); 41 42 // Object 43 static size_t object_size(uintptr_t addr); 44 static void object_copy(uintptr_t from, uintptr_t to, size_t size); 45 }; 46 47 #endif // SHARE_GC_Z_ZUTILS_HPP | 22 */ 23 24 #ifndef SHARE_GC_Z_ZUTILS_HPP 25 #define SHARE_GC_Z_ZUTILS_HPP 26 27 #include "memory/allocation.hpp" 28 29 class ZUtils : public AllStatic { 30 public: 31 // Allocation 32 static uintptr_t alloc_aligned(size_t alignment, size_t size); 33 34 // Power of two 35 static size_t round_up_power_of_2(size_t value); 36 static size_t round_down_power_of_2(size_t value); 37 38 // Size conversion 39 static size_t bytes_to_words(size_t size_in_words); 40 static size_t words_to_bytes(size_t size_in_words); 41 42 // Memory 43 static void zero(uintptr_t addr, size_t size); 44 45 // Object 46 static size_t object_size(uintptr_t addr); 47 static void object_copy(uintptr_t from, uintptr_t to, size_t size); 48 }; 49 50 #endif // SHARE_GC_Z_ZUTILS_HPP |