mirror of
https://github.com/openjdk/jdk.git
synced 2025-09-18 10:04:42 +02:00
8227168: Cleanup usage of NEW_C_HEAP_ARRAY
Reviewed-by: coleenp, dholmes, kbarrett, tschatzl
This commit is contained in:
parent
a73f96ef60
commit
eafb888c18
23 changed files with 73 additions and 89 deletions
|
@ -503,12 +503,12 @@ CPUPerformanceInterface::CPUPerformance::CPUPerformance() {
|
|||
}
|
||||
|
||||
bool CPUPerformanceInterface::CPUPerformance::initialize() {
|
||||
size_t tick_array_size = (_counters.nProcs +1) * sizeof(os::Linux::CPUPerfTicks);
|
||||
_counters.cpus = (os::Linux::CPUPerfTicks*)NEW_C_HEAP_ARRAY(char, tick_array_size, mtInternal);
|
||||
size_t array_entry_count = _counters.nProcs + 1;
|
||||
_counters.cpus = NEW_C_HEAP_ARRAY(os::Linux::CPUPerfTicks, array_entry_count, mtInternal);
|
||||
if (NULL == _counters.cpus) {
|
||||
return false;
|
||||
}
|
||||
memset(_counters.cpus, 0, tick_array_size);
|
||||
memset(_counters.cpus, 0, array_entry_count * sizeof(*_counters.cpus));
|
||||
|
||||
// For the CPU load total
|
||||
os::Linux::get_tick_information(&_counters.cpus[_counters.nProcs], -1);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue