equal
deleted
inserted
replaced
81 |
81 |
82 // NOT thread-safe, but this is called during dump time in single-threaded mode. |
82 // NOT thread-safe, but this is called during dump time in single-threaded mode. |
83 char* SharedMiscRegion::alloc(size_t num_bytes) { |
83 char* SharedMiscRegion::alloc(size_t num_bytes) { |
84 assert(DumpSharedSpaces, "dump time only"); |
84 assert(DumpSharedSpaces, "dump time only"); |
85 size_t alignment = sizeof(char*); |
85 size_t alignment = sizeof(char*); |
86 num_bytes = align_size_up(num_bytes, alignment); |
86 num_bytes = align_up(num_bytes, alignment); |
87 _alloc_top = align_ptr_up(_alloc_top, alignment); |
87 _alloc_top = align_up(_alloc_top, alignment); |
88 if (_alloc_top + num_bytes > _vs.high()) { |
88 if (_alloc_top + num_bytes > _vs.high()) { |
89 report_out_of_shared_space(_space_type); |
89 report_out_of_shared_space(_space_type); |
90 } |
90 } |
91 |
91 |
92 char* p = _alloc_top; |
92 char* p = _alloc_top; |