diff a/src/hotspot/os/windows/os_perf_windows.cpp b/src/hotspot/os/windows/os_perf_windows.cpp --- a/src/hotspot/os/windows/os_perf_windows.cpp +++ b/src/hotspot/os/windows/os_perf_windows.cpp @@ -134,11 +134,11 @@ *query = NULL; } } static CounterQueryP create_counter_query() { - CounterQueryP const query = NEW_C_HEAP_ARRAY(CounterQueryS, 1, mtInternal); + CounterQueryP const query = NEW_C_HEAP_OBJ(CounterQueryS, mtInternal); memset(query, 0, sizeof(CounterQueryS)); return query; } static void destroy_counter_query(CounterQueryP query) { @@ -142,11 +142,11 @@ } static void destroy_counter_query(CounterQueryP query) { assert(query != NULL, "invariant"); pdh_cleanup(&query->query.query, &query->counter); - FREE_C_HEAP_ARRAY(CounterQueryS, query); + FREE_C_HEAP_OBJ(query); } static MultiCounterQueryP create_multi_counter_query() { MultiCounterQueryP const query = NEW_C_HEAP_ARRAY(MultiCounterQueryS, 1, mtInternal); memset(query, 0, sizeof(MultiCounterQueryS)); @@ -180,11 +180,11 @@ FREE_C_HEAP_ARRAY(MultiCounterQuerySetS, counter_query_set); } static void destroy_counter_query(ProcessQueryP process_query) { destroy_multi_counter_query(&process_query->set); - FREE_C_HEAP_ARRAY(ProcessQueryS, process_query); + FREE_C_HEAP_OBJ(process_query); } static int open_query(HQUERY* query) { return PdhDll::PdhOpenQuery(NULL, 0, query); } @@ -197,11 +197,11 @@ static int allocate_counters(MultiCounterQueryP query, size_t nofCounters) { assert(query != NULL, "invariant"); assert(!query->initialized, "invariant"); assert(0 == query->noOfCounters, "invariant"); assert(query->counters == NULL, "invariant"); - query->counters = (HCOUNTER*)NEW_C_HEAP_ARRAY(char, nofCounters * sizeof(HCOUNTER), mtInternal); + query->counters = NEW_C_HEAP_ARRAY(HCOUNTER, nofCounters, mtInternal); if (query->counters == NULL) { return OS_ERR; } memset(query->counters, 0, nofCounters * sizeof(HCOUNTER)); query->noOfCounters = (int)nofCounters; @@ -386,11 +386,11 @@ static ProcessQueryP create_process_query() { const int current_process_idx = current_query_index_for_process(); if (OS_ERR == current_process_idx) { return NULL; } - ProcessQueryP const process_query = NEW_C_HEAP_ARRAY(ProcessQueryS, 1, mtInternal); + ProcessQueryP const process_query = NEW_C_HEAP_OBJ(ProcessQueryS, mtInternal); memset(process_query, 0, sizeof(ProcessQueryS)); process_query->set.queries = NEW_C_HEAP_ARRAY(MultiCounterQueryS, current_process_idx + 1, mtInternal); memset(process_query->set.queries, 0, sizeof(MultiCounterQueryS) * (current_process_idx + 1)); process_query->process_index = current_process_idx; process_query->set.size = current_process_idx + 1;