mirror of
https://github.com/openjdk/jdk.git
synced 2026-04-21 12:20:29 +00:00
8382401: Remove return type parameters from FREE_ and REALLOC_ macros
Reviewed-by: tschatzl, dholmes
This commit is contained in:
parent
9a689b0171
commit
abd3d46204
@ -2527,7 +2527,7 @@ const char* VM_Version::cpu_brand_string(void) {
|
||||
}
|
||||
int ret_val = cpu_extended_brand_string(_cpu_brand_string, CPU_EBS_MAX_LENGTH);
|
||||
if (ret_val != OS_OK) {
|
||||
FREE_C_HEAP_ARRAY(char, _cpu_brand_string);
|
||||
FREE_C_HEAP_ARRAY(_cpu_brand_string);
|
||||
_cpu_brand_string = nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
@ -578,13 +578,13 @@ void os::init_system_properties_values() {
|
||||
char *ld_library_path = NEW_C_HEAP_ARRAY(char, pathsize, mtInternal);
|
||||
os::snprintf_checked(ld_library_path, pathsize, "%s%s" DEFAULT_LIBPATH, v, v_colon);
|
||||
Arguments::set_library_path(ld_library_path);
|
||||
FREE_C_HEAP_ARRAY(char, ld_library_path);
|
||||
FREE_C_HEAP_ARRAY(ld_library_path);
|
||||
|
||||
// Extensions directories.
|
||||
os::snprintf_checked(buf, bufsize, "%s" EXTENSIONS_DIR, Arguments::get_java_home());
|
||||
Arguments::set_ext_dirs(buf);
|
||||
|
||||
FREE_C_HEAP_ARRAY(char, buf);
|
||||
FREE_C_HEAP_ARRAY(buf);
|
||||
|
||||
#undef DEFAULT_LIBPATH
|
||||
#undef EXTENSIONS_DIR
|
||||
|
||||
@ -258,10 +258,10 @@ bool CPUPerformanceInterface::CPUPerformance::initialize() {
|
||||
|
||||
CPUPerformanceInterface::CPUPerformance::~CPUPerformance() {
|
||||
if (_lcpu_names) {
|
||||
FREE_C_HEAP_ARRAY(perfstat_id_t, _lcpu_names);
|
||||
FREE_C_HEAP_ARRAY(_lcpu_names);
|
||||
}
|
||||
if (_prev_ticks) {
|
||||
FREE_C_HEAP_ARRAY(cpu_tick_store_t, _prev_ticks);
|
||||
FREE_C_HEAP_ARRAY(_prev_ticks);
|
||||
}
|
||||
}
|
||||
|
||||
@ -511,12 +511,12 @@ CPUInformationInterface::~CPUInformationInterface() {
|
||||
if (_cpu_info != nullptr) {
|
||||
if (_cpu_info->cpu_name() != nullptr) {
|
||||
const char* cpu_name = _cpu_info->cpu_name();
|
||||
FREE_C_HEAP_ARRAY(char, cpu_name);
|
||||
FREE_C_HEAP_ARRAY(cpu_name);
|
||||
_cpu_info->set_cpu_name(nullptr);
|
||||
}
|
||||
if (_cpu_info->cpu_description() != nullptr) {
|
||||
const char* cpu_desc = _cpu_info->cpu_description();
|
||||
FREE_C_HEAP_ARRAY(char, cpu_desc);
|
||||
FREE_C_HEAP_ARRAY(cpu_desc);
|
||||
_cpu_info->set_cpu_description(nullptr);
|
||||
}
|
||||
delete _cpu_info;
|
||||
@ -576,7 +576,7 @@ int NetworkPerformanceInterface::NetworkPerformance::network_utilization(Network
|
||||
|
||||
// check for error
|
||||
if (n_records < 0) {
|
||||
FREE_C_HEAP_ARRAY(perfstat_netinterface_t, net_stats);
|
||||
FREE_C_HEAP_ARRAY(net_stats);
|
||||
return OS_ERR;
|
||||
}
|
||||
|
||||
@ -593,7 +593,7 @@ int NetworkPerformanceInterface::NetworkPerformance::network_utilization(Network
|
||||
*network_interfaces = new_interface;
|
||||
}
|
||||
|
||||
FREE_C_HEAP_ARRAY(perfstat_netinterface_t, net_stats);
|
||||
FREE_C_HEAP_ARRAY(net_stats);
|
||||
return OS_OK;
|
||||
}
|
||||
|
||||
|
||||
@ -444,14 +444,14 @@ void os::init_system_properties_values() {
|
||||
char *ld_library_path = NEW_C_HEAP_ARRAY(char, ld_library_path_size, mtInternal);
|
||||
os::snprintf_checked(ld_library_path, ld_library_path_size, "%s%s" SYS_EXT_DIR "/lib/%s:" DEFAULT_LIBPATH, v, v_colon, cpu_arch);
|
||||
Arguments::set_library_path(ld_library_path);
|
||||
FREE_C_HEAP_ARRAY(char, ld_library_path);
|
||||
FREE_C_HEAP_ARRAY(ld_library_path);
|
||||
}
|
||||
|
||||
// Extensions directories.
|
||||
os::snprintf_checked(buf, bufsize, "%s" EXTENSIONS_DIR ":" SYS_EXT_DIR EXTENSIONS_DIR, Arguments::get_java_home());
|
||||
Arguments::set_ext_dirs(buf);
|
||||
|
||||
FREE_C_HEAP_ARRAY(char, buf);
|
||||
FREE_C_HEAP_ARRAY(buf);
|
||||
|
||||
#else // __APPLE__
|
||||
|
||||
@ -538,7 +538,7 @@ void os::init_system_properties_values() {
|
||||
os::snprintf_checked(ld_library_path, ld_library_path_size, "%s%s%s%s%s" SYS_EXTENSIONS_DIR ":" SYS_EXTENSIONS_DIRS ":.",
|
||||
v, v_colon, l, l_colon, user_home_dir);
|
||||
Arguments::set_library_path(ld_library_path);
|
||||
FREE_C_HEAP_ARRAY(char, ld_library_path);
|
||||
FREE_C_HEAP_ARRAY(ld_library_path);
|
||||
}
|
||||
|
||||
// Extensions directories.
|
||||
@ -550,7 +550,7 @@ void os::init_system_properties_values() {
|
||||
user_home_dir, Arguments::get_java_home());
|
||||
Arguments::set_ext_dirs(buf);
|
||||
|
||||
FREE_C_HEAP_ARRAY(char, buf);
|
||||
FREE_C_HEAP_ARRAY(buf);
|
||||
|
||||
#undef SYS_EXTENSIONS_DIR
|
||||
#undef SYS_EXTENSIONS_DIRS
|
||||
|
||||
@ -301,7 +301,7 @@ int SystemProcessInterface::SystemProcesses::system_processes(SystemProcess** sy
|
||||
pids_bytes = proc_listpids(PROC_ALL_PIDS, 0, pids, pids_bytes);
|
||||
if (pids_bytes <= 0) {
|
||||
// couldn't fit buffer, retry.
|
||||
FREE_RESOURCE_ARRAY(pid_t, pids, pid_count);
|
||||
FREE_RESOURCE_ARRAY(pids, pid_count);
|
||||
pids = nullptr;
|
||||
try_count++;
|
||||
if (try_count > 3) {
|
||||
@ -381,12 +381,12 @@ CPUInformationInterface::~CPUInformationInterface() {
|
||||
if (_cpu_info != nullptr) {
|
||||
if (_cpu_info->cpu_name() != nullptr) {
|
||||
const char* cpu_name = _cpu_info->cpu_name();
|
||||
FREE_C_HEAP_ARRAY(char, cpu_name);
|
||||
FREE_C_HEAP_ARRAY(cpu_name);
|
||||
_cpu_info->set_cpu_name(nullptr);
|
||||
}
|
||||
if (_cpu_info->cpu_description() != nullptr) {
|
||||
const char* cpu_desc = _cpu_info->cpu_description();
|
||||
FREE_C_HEAP_ARRAY(char, cpu_desc);
|
||||
FREE_C_HEAP_ARRAY(cpu_desc);
|
||||
_cpu_info->set_cpu_description(nullptr);
|
||||
}
|
||||
delete _cpu_info;
|
||||
|
||||
@ -710,14 +710,14 @@ void os::init_system_properties_values() {
|
||||
char *ld_library_path = NEW_C_HEAP_ARRAY(char, pathsize, mtInternal);
|
||||
os::snprintf_checked(ld_library_path, pathsize, "%s%s" SYS_EXT_DIR "/lib:" DEFAULT_LIBPATH, v, v_colon);
|
||||
Arguments::set_library_path(ld_library_path);
|
||||
FREE_C_HEAP_ARRAY(char, ld_library_path);
|
||||
FREE_C_HEAP_ARRAY(ld_library_path);
|
||||
}
|
||||
|
||||
// Extensions directories.
|
||||
os::snprintf_checked(buf, bufsize, "%s" EXTENSIONS_DIR ":" SYS_EXT_DIR EXTENSIONS_DIR, Arguments::get_java_home());
|
||||
Arguments::set_ext_dirs(buf);
|
||||
|
||||
FREE_C_HEAP_ARRAY(char, buf);
|
||||
FREE_C_HEAP_ARRAY(buf);
|
||||
|
||||
#undef DEFAULT_LIBPATH
|
||||
#undef SYS_EXT_DIR
|
||||
@ -3435,7 +3435,7 @@ void os::Linux::rebuild_cpu_to_node_map() {
|
||||
}
|
||||
}
|
||||
}
|
||||
FREE_C_HEAP_ARRAY(unsigned long, cpu_map);
|
||||
FREE_C_HEAP_ARRAY(cpu_map);
|
||||
}
|
||||
|
||||
int os::Linux::numa_node_to_cpus(int node, unsigned long *buffer, int bufferlen) {
|
||||
|
||||
@ -545,7 +545,7 @@ bool CPUPerformanceInterface::CPUPerformance::initialize() {
|
||||
|
||||
CPUPerformanceInterface::CPUPerformance::~CPUPerformance() {
|
||||
if (_counters.cpus != nullptr) {
|
||||
FREE_C_HEAP_ARRAY(char, _counters.cpus);
|
||||
FREE_C_HEAP_ARRAY(_counters.cpus);
|
||||
}
|
||||
}
|
||||
|
||||
@ -811,7 +811,7 @@ int SystemProcessInterface::SystemProcesses::ProcessIterator::current(SystemProc
|
||||
cmdline = get_cmdline();
|
||||
if (cmdline != nullptr) {
|
||||
process_info->set_command_line(allocate_string(cmdline));
|
||||
FREE_C_HEAP_ARRAY(char, cmdline);
|
||||
FREE_C_HEAP_ARRAY(cmdline);
|
||||
}
|
||||
|
||||
return OS_OK;
|
||||
@ -937,12 +937,12 @@ CPUInformationInterface::~CPUInformationInterface() {
|
||||
if (_cpu_info != nullptr) {
|
||||
if (_cpu_info->cpu_name() != nullptr) {
|
||||
const char* cpu_name = _cpu_info->cpu_name();
|
||||
FREE_C_HEAP_ARRAY(char, cpu_name);
|
||||
FREE_C_HEAP_ARRAY(cpu_name);
|
||||
_cpu_info->set_cpu_name(nullptr);
|
||||
}
|
||||
if (_cpu_info->cpu_description() != nullptr) {
|
||||
const char* cpu_desc = _cpu_info->cpu_description();
|
||||
FREE_C_HEAP_ARRAY(char, cpu_desc);
|
||||
FREE_C_HEAP_ARRAY(cpu_desc);
|
||||
_cpu_info->set_cpu_description(nullptr);
|
||||
}
|
||||
delete _cpu_info;
|
||||
|
||||
@ -45,7 +45,7 @@ ProcSmapsParser::ProcSmapsParser(FILE* f) :
|
||||
}
|
||||
|
||||
ProcSmapsParser::~ProcSmapsParser() {
|
||||
FREE_C_HEAP_ARRAY(char, _line);
|
||||
FREE_C_HEAP_ARRAY(_line);
|
||||
}
|
||||
|
||||
bool ProcSmapsParser::read_line() {
|
||||
|
||||
@ -118,7 +118,7 @@ static void save_memory_to_file(char* addr, size_t size) {
|
||||
}
|
||||
}
|
||||
}
|
||||
FREE_C_HEAP_ARRAY(char, destfile);
|
||||
FREE_C_HEAP_ARRAY(destfile);
|
||||
}
|
||||
|
||||
|
||||
@ -483,14 +483,14 @@ static char* get_user_name(uid_t uid) {
|
||||
p->pw_name == nullptr ? "pw_name = null" : "pw_name zero length");
|
||||
}
|
||||
}
|
||||
FREE_C_HEAP_ARRAY(char, pwbuf);
|
||||
FREE_C_HEAP_ARRAY(pwbuf);
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
char* user_name = NEW_C_HEAP_ARRAY(char, strlen(p->pw_name) + 1, mtInternal);
|
||||
strcpy(user_name, p->pw_name);
|
||||
|
||||
FREE_C_HEAP_ARRAY(char, pwbuf);
|
||||
FREE_C_HEAP_ARRAY(pwbuf);
|
||||
return user_name;
|
||||
}
|
||||
|
||||
@ -572,7 +572,7 @@ static char* get_user_name_slow(int vmid, int nspid, TRAPS) {
|
||||
DIR* subdirp = open_directory_secure(usrdir_name);
|
||||
|
||||
if (subdirp == nullptr) {
|
||||
FREE_C_HEAP_ARRAY(char, usrdir_name);
|
||||
FREE_C_HEAP_ARRAY(usrdir_name);
|
||||
continue;
|
||||
}
|
||||
|
||||
@ -583,7 +583,7 @@ static char* get_user_name_slow(int vmid, int nspid, TRAPS) {
|
||||
// symlink can be exploited.
|
||||
//
|
||||
if (!is_directory_secure(usrdir_name)) {
|
||||
FREE_C_HEAP_ARRAY(char, usrdir_name);
|
||||
FREE_C_HEAP_ARRAY(usrdir_name);
|
||||
os::closedir(subdirp);
|
||||
continue;
|
||||
}
|
||||
@ -607,13 +607,13 @@ static char* get_user_name_slow(int vmid, int nspid, TRAPS) {
|
||||
// don't follow symbolic links for the file
|
||||
RESTARTABLE(::lstat(filename, &statbuf), result);
|
||||
if (result == OS_ERR) {
|
||||
FREE_C_HEAP_ARRAY(char, filename);
|
||||
FREE_C_HEAP_ARRAY(filename);
|
||||
continue;
|
||||
}
|
||||
|
||||
// skip over files that are not regular files.
|
||||
if (!S_ISREG(statbuf.st_mode)) {
|
||||
FREE_C_HEAP_ARRAY(char, filename);
|
||||
FREE_C_HEAP_ARRAY(filename);
|
||||
continue;
|
||||
}
|
||||
|
||||
@ -623,7 +623,7 @@ static char* get_user_name_slow(int vmid, int nspid, TRAPS) {
|
||||
if (statbuf.st_ctime > oldest_ctime) {
|
||||
char* user = strchr(dentry->d_name, '_') + 1;
|
||||
|
||||
FREE_C_HEAP_ARRAY(char, oldest_user);
|
||||
FREE_C_HEAP_ARRAY(oldest_user);
|
||||
oldest_user = NEW_C_HEAP_ARRAY(char, strlen(user)+1, mtInternal);
|
||||
|
||||
strcpy(oldest_user, user);
|
||||
@ -631,11 +631,11 @@ static char* get_user_name_slow(int vmid, int nspid, TRAPS) {
|
||||
}
|
||||
}
|
||||
|
||||
FREE_C_HEAP_ARRAY(char, filename);
|
||||
FREE_C_HEAP_ARRAY(filename);
|
||||
}
|
||||
}
|
||||
os::closedir(subdirp);
|
||||
FREE_C_HEAP_ARRAY(char, usrdir_name);
|
||||
FREE_C_HEAP_ARRAY(usrdir_name);
|
||||
}
|
||||
os::closedir(tmpdirp);
|
||||
|
||||
@ -1105,11 +1105,11 @@ static char* mmap_create_shared(size_t size) {
|
||||
log_info(perf, memops)("Trying to open %s/%s", dirname, short_filename);
|
||||
fd = create_sharedmem_file(dirname, short_filename, size);
|
||||
|
||||
FREE_C_HEAP_ARRAY(char, user_name);
|
||||
FREE_C_HEAP_ARRAY(char, dirname);
|
||||
FREE_C_HEAP_ARRAY(user_name);
|
||||
FREE_C_HEAP_ARRAY(dirname);
|
||||
|
||||
if (fd == -1) {
|
||||
FREE_C_HEAP_ARRAY(char, filename);
|
||||
FREE_C_HEAP_ARRAY(filename);
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
@ -1121,7 +1121,7 @@ static char* mmap_create_shared(size_t size) {
|
||||
if (mapAddress == MAP_FAILED) {
|
||||
log_debug(perf)("mmap failed - %s", os::strerror(errno));
|
||||
remove_file(filename);
|
||||
FREE_C_HEAP_ARRAY(char, filename);
|
||||
FREE_C_HEAP_ARRAY(filename);
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
@ -1171,7 +1171,7 @@ static void delete_shared_memory(char* addr, size_t size) {
|
||||
remove_file(backing_store_file_name);
|
||||
// Don't.. Free heap memory could deadlock os::abort() if it is called
|
||||
// from signal handler. OS will reclaim the heap memory.
|
||||
// FREE_C_HEAP_ARRAY(char, backing_store_file_name);
|
||||
// FREE_C_HEAP_ARRAY(backing_store_file_name);
|
||||
backing_store_file_name = nullptr;
|
||||
}
|
||||
}
|
||||
@ -1223,8 +1223,8 @@ static void mmap_attach_shared(int vmid, char** addr, size_t* sizep, TRAPS) {
|
||||
// store file, we don't follow them when attaching either.
|
||||
//
|
||||
if (!is_directory_secure(dirname)) {
|
||||
FREE_C_HEAP_ARRAY(char, dirname);
|
||||
FREE_C_HEAP_ARRAY(char, luser);
|
||||
FREE_C_HEAP_ARRAY(dirname);
|
||||
FREE_C_HEAP_ARRAY(luser);
|
||||
THROW_MSG(vmSymbols::java_lang_IllegalArgumentException(),
|
||||
"Process not found");
|
||||
}
|
||||
@ -1236,9 +1236,9 @@ static void mmap_attach_shared(int vmid, char** addr, size_t* sizep, TRAPS) {
|
||||
int fd = open_sharedmem_file(filename, file_flags, THREAD);
|
||||
|
||||
// free the c heap resources that are no longer needed
|
||||
FREE_C_HEAP_ARRAY(char, luser);
|
||||
FREE_C_HEAP_ARRAY(char, dirname);
|
||||
FREE_C_HEAP_ARRAY(char, filename);
|
||||
FREE_C_HEAP_ARRAY(luser);
|
||||
FREE_C_HEAP_ARRAY(dirname);
|
||||
FREE_C_HEAP_ARRAY(filename);
|
||||
|
||||
if (HAS_PENDING_EXCEPTION) {
|
||||
assert(fd == OS_ERR, "open_sharedmem_file always return OS_ERR on exceptions");
|
||||
|
||||
@ -178,9 +178,9 @@ static void destroy(MultiCounterQueryP query) {
|
||||
for (int i = 0; i < query->noOfCounters; ++i) {
|
||||
close_query(nullptr, &query->counters[i]);
|
||||
}
|
||||
FREE_C_HEAP_ARRAY(char, query->counters);
|
||||
FREE_C_HEAP_ARRAY(query->counters);
|
||||
close_query(&query->query.pdh_query_handle, nullptr);
|
||||
FREE_C_HEAP_ARRAY(MultiCounterQueryS, query);
|
||||
FREE_C_HEAP_ARRAY(query);
|
||||
}
|
||||
}
|
||||
|
||||
@ -189,15 +189,15 @@ static void destroy_query_set(MultiCounterQuerySetP query_set) {
|
||||
for (int j = 0; j < query_set->queries[i].noOfCounters; ++j) {
|
||||
close_query(nullptr, &query_set->queries[i].counters[j]);
|
||||
}
|
||||
FREE_C_HEAP_ARRAY(char, query_set->queries[i].counters);
|
||||
FREE_C_HEAP_ARRAY(query_set->queries[i].counters);
|
||||
close_query(&query_set->queries[i].query.pdh_query_handle, nullptr);
|
||||
}
|
||||
FREE_C_HEAP_ARRAY(MultiCounterQueryS, query_set->queries);
|
||||
FREE_C_HEAP_ARRAY(query_set->queries);
|
||||
}
|
||||
|
||||
static void destroy(MultiCounterQuerySetP query) {
|
||||
destroy_query_set(query);
|
||||
FREE_C_HEAP_ARRAY(MultiCounterQuerySetS, query);
|
||||
FREE_C_HEAP_ARRAY(query);
|
||||
}
|
||||
|
||||
static void destroy(ProcessQueryP query) {
|
||||
@ -229,7 +229,7 @@ static void allocate_counters(ProcessQueryP query, size_t nofCounters) {
|
||||
}
|
||||
|
||||
static void deallocate_counters(MultiCounterQueryP query) {
|
||||
FREE_C_HEAP_ARRAY(char, query->counters);
|
||||
FREE_C_HEAP_ARRAY(query->counters);
|
||||
query->counters = nullptr;
|
||||
query->noOfCounters = 0;
|
||||
}
|
||||
@ -710,11 +710,11 @@ static const char* pdh_process_image_name() {
|
||||
}
|
||||
|
||||
static void deallocate_pdh_constants() {
|
||||
FREE_C_HEAP_ARRAY(char, process_image_name);
|
||||
FREE_C_HEAP_ARRAY(process_image_name);
|
||||
process_image_name = nullptr;
|
||||
FREE_C_HEAP_ARRAY(char, pdh_process_instance_IDProcess_counter_fmt);
|
||||
FREE_C_HEAP_ARRAY(pdh_process_instance_IDProcess_counter_fmt);
|
||||
pdh_process_instance_IDProcess_counter_fmt = nullptr;
|
||||
FREE_C_HEAP_ARRAY(char, pdh_process_instance_wildcard_IDProcess_counter);
|
||||
FREE_C_HEAP_ARRAY(pdh_process_instance_wildcard_IDProcess_counter);
|
||||
pdh_process_instance_wildcard_IDProcess_counter = nullptr;
|
||||
}
|
||||
|
||||
@ -1445,9 +1445,9 @@ bool CPUInformationInterface::initialize() {
|
||||
|
||||
CPUInformationInterface::~CPUInformationInterface() {
|
||||
if (_cpu_info != nullptr) {
|
||||
FREE_C_HEAP_ARRAY(char, _cpu_info->cpu_name());
|
||||
FREE_C_HEAP_ARRAY(_cpu_info->cpu_name());
|
||||
_cpu_info->set_cpu_name(nullptr);
|
||||
FREE_C_HEAP_ARRAY(char, _cpu_info->cpu_description());
|
||||
FREE_C_HEAP_ARRAY(_cpu_info->cpu_description());
|
||||
_cpu_info->set_cpu_description(nullptr);
|
||||
delete _cpu_info;
|
||||
}
|
||||
|
||||
@ -334,14 +334,14 @@ void os::init_system_properties_values() {
|
||||
home_path = NEW_C_HEAP_ARRAY(char, strlen(home_dir) + 1, mtInternal);
|
||||
strcpy(home_path, home_dir);
|
||||
Arguments::set_java_home(home_path);
|
||||
FREE_C_HEAP_ARRAY(char, home_path);
|
||||
FREE_C_HEAP_ARRAY(home_path);
|
||||
|
||||
dll_path = NEW_C_HEAP_ARRAY(char, strlen(home_dir) + strlen(bin) + 1,
|
||||
mtInternal);
|
||||
strcpy(dll_path, home_dir);
|
||||
strcat(dll_path, bin);
|
||||
Arguments::set_dll_dir(dll_path);
|
||||
FREE_C_HEAP_ARRAY(char, dll_path);
|
||||
FREE_C_HEAP_ARRAY(dll_path);
|
||||
|
||||
if (!set_boot_path('\\', ';')) {
|
||||
vm_exit_during_initialization("Failed setting boot class path.", nullptr);
|
||||
@ -396,7 +396,7 @@ void os::init_system_properties_values() {
|
||||
strcat(library_path, ";.");
|
||||
|
||||
Arguments::set_library_path(library_path);
|
||||
FREE_C_HEAP_ARRAY(char, library_path);
|
||||
FREE_C_HEAP_ARRAY(library_path);
|
||||
}
|
||||
|
||||
// Default extensions directory
|
||||
@ -1079,7 +1079,7 @@ void os::set_native_thread_name(const char *name) {
|
||||
HRESULT hr = _SetThreadDescription(current, unicode_name);
|
||||
if (FAILED(hr)) {
|
||||
log_debug(os, thread)("set_native_thread_name: SetThreadDescription failed - falling back to debugger method");
|
||||
FREE_C_HEAP_ARRAY(WCHAR, unicode_name);
|
||||
FREE_C_HEAP_ARRAY(unicode_name);
|
||||
} else {
|
||||
log_trace(os, thread)("set_native_thread_name: SetThreadDescription succeeded - new name: %s", name);
|
||||
|
||||
@ -1102,7 +1102,7 @@ void os::set_native_thread_name(const char *name) {
|
||||
LocalFree(thread_name);
|
||||
}
|
||||
#endif
|
||||
FREE_C_HEAP_ARRAY(WCHAR, unicode_name);
|
||||
FREE_C_HEAP_ARRAY(unicode_name);
|
||||
return;
|
||||
}
|
||||
} else {
|
||||
@ -2897,7 +2897,7 @@ class NUMANodeListHolder {
|
||||
int _numa_used_node_count;
|
||||
|
||||
void free_node_list() {
|
||||
FREE_C_HEAP_ARRAY(int, _numa_used_node_list);
|
||||
FREE_C_HEAP_ARRAY(_numa_used_node_list);
|
||||
}
|
||||
|
||||
public:
|
||||
@ -4744,7 +4744,7 @@ static wchar_t* wide_abs_unc_path(char const* path, errno_t & err, int additiona
|
||||
|
||||
LPWSTR unicode_path = nullptr;
|
||||
err = convert_to_unicode(buf, &unicode_path);
|
||||
FREE_C_HEAP_ARRAY(char, buf);
|
||||
FREE_C_HEAP_ARRAY(buf);
|
||||
if (err != ERROR_SUCCESS) {
|
||||
return nullptr;
|
||||
}
|
||||
@ -4772,9 +4772,9 @@ static wchar_t* wide_abs_unc_path(char const* path, errno_t & err, int additiona
|
||||
}
|
||||
|
||||
if (converted_path != unicode_path) {
|
||||
FREE_C_HEAP_ARRAY(WCHAR, converted_path);
|
||||
FREE_C_HEAP_ARRAY(converted_path);
|
||||
}
|
||||
FREE_C_HEAP_ARRAY(WCHAR, unicode_path);
|
||||
FREE_C_HEAP_ARRAY(unicode_path);
|
||||
|
||||
return static_cast<wchar_t*>(result); // LPWSTR and wchat_t* are the same type on Windows.
|
||||
}
|
||||
@ -5827,7 +5827,7 @@ int os::fork_and_exec(const char* cmd) {
|
||||
exit_code = -1;
|
||||
}
|
||||
|
||||
FREE_C_HEAP_ARRAY(char, cmd_string);
|
||||
FREE_C_HEAP_ARRAY(cmd_string);
|
||||
return (int)exit_code;
|
||||
}
|
||||
|
||||
|
||||
@ -113,7 +113,7 @@ static void save_memory_to_file(char* addr, size_t size) {
|
||||
}
|
||||
}
|
||||
|
||||
FREE_C_HEAP_ARRAY(char, destfile);
|
||||
FREE_C_HEAP_ARRAY(destfile);
|
||||
}
|
||||
|
||||
// Shared Memory Implementation Details
|
||||
@ -319,7 +319,7 @@ static char* get_user_name_slow(int vmid) {
|
||||
DIR* subdirp = os::opendir(usrdir_name);
|
||||
|
||||
if (subdirp == nullptr) {
|
||||
FREE_C_HEAP_ARRAY(char, usrdir_name);
|
||||
FREE_C_HEAP_ARRAY(usrdir_name);
|
||||
continue;
|
||||
}
|
||||
|
||||
@ -330,7 +330,7 @@ static char* get_user_name_slow(int vmid) {
|
||||
// symlink can be exploited.
|
||||
//
|
||||
if (!is_directory_secure(usrdir_name)) {
|
||||
FREE_C_HEAP_ARRAY(char, usrdir_name);
|
||||
FREE_C_HEAP_ARRAY(usrdir_name);
|
||||
os::closedir(subdirp);
|
||||
continue;
|
||||
}
|
||||
@ -350,13 +350,13 @@ static char* get_user_name_slow(int vmid) {
|
||||
strcat(filename, udentry->d_name);
|
||||
|
||||
if (::stat(filename, &statbuf) == OS_ERR) {
|
||||
FREE_C_HEAP_ARRAY(char, filename);
|
||||
FREE_C_HEAP_ARRAY(filename);
|
||||
continue;
|
||||
}
|
||||
|
||||
// skip over files that are not regular files.
|
||||
if ((statbuf.st_mode & S_IFMT) != S_IFREG) {
|
||||
FREE_C_HEAP_ARRAY(char, filename);
|
||||
FREE_C_HEAP_ARRAY(filename);
|
||||
continue;
|
||||
}
|
||||
|
||||
@ -378,18 +378,18 @@ static char* get_user_name_slow(int vmid) {
|
||||
if (statbuf.st_ctime > latest_ctime) {
|
||||
char* user = strchr(dentry->d_name, '_') + 1;
|
||||
|
||||
FREE_C_HEAP_ARRAY(char, latest_user);
|
||||
FREE_C_HEAP_ARRAY(latest_user);
|
||||
latest_user = NEW_C_HEAP_ARRAY(char, strlen(user)+1, mtInternal);
|
||||
|
||||
strcpy(latest_user, user);
|
||||
latest_ctime = statbuf.st_ctime;
|
||||
}
|
||||
|
||||
FREE_C_HEAP_ARRAY(char, filename);
|
||||
FREE_C_HEAP_ARRAY(filename);
|
||||
}
|
||||
}
|
||||
os::closedir(subdirp);
|
||||
FREE_C_HEAP_ARRAY(char, usrdir_name);
|
||||
FREE_C_HEAP_ARRAY(usrdir_name);
|
||||
}
|
||||
os::closedir(tmpdirp);
|
||||
|
||||
@ -481,7 +481,7 @@ static void remove_file(const char* dirname, const char* filename) {
|
||||
}
|
||||
}
|
||||
|
||||
FREE_C_HEAP_ARRAY(char, path);
|
||||
FREE_C_HEAP_ARRAY(path);
|
||||
}
|
||||
|
||||
// returns true if the process represented by pid is alive, otherwise
|
||||
@ -708,11 +708,11 @@ static void free_security_desc(PSECURITY_DESCRIPTOR pSD) {
|
||||
// be an ACL we enlisted. free the resources.
|
||||
//
|
||||
if (success && exists && pACL != nullptr && !isdefault) {
|
||||
FREE_C_HEAP_ARRAY(char, pACL);
|
||||
FREE_C_HEAP_ARRAY(pACL);
|
||||
}
|
||||
|
||||
// free the security descriptor
|
||||
FREE_C_HEAP_ARRAY(char, pSD);
|
||||
FREE_C_HEAP_ARRAY(pSD);
|
||||
}
|
||||
}
|
||||
|
||||
@ -768,7 +768,7 @@ static PSID get_user_sid(HANDLE hProcess) {
|
||||
if (!GetTokenInformation(hAccessToken, TokenUser, token_buf, rsize, &rsize)) {
|
||||
log_debug(perf)("GetTokenInformation failure: lasterror = %d, rsize = %d",
|
||||
GetLastError(), rsize);
|
||||
FREE_C_HEAP_ARRAY(char, token_buf);
|
||||
FREE_C_HEAP_ARRAY(token_buf);
|
||||
CloseHandle(hAccessToken);
|
||||
return nullptr;
|
||||
}
|
||||
@ -779,15 +779,15 @@ static PSID get_user_sid(HANDLE hProcess) {
|
||||
if (!CopySid(nbytes, pSID, token_buf->User.Sid)) {
|
||||
log_debug(perf)("GetTokenInformation failure: lasterror = %d, rsize = %d",
|
||||
GetLastError(), rsize);
|
||||
FREE_C_HEAP_ARRAY(char, token_buf);
|
||||
FREE_C_HEAP_ARRAY(char, pSID);
|
||||
FREE_C_HEAP_ARRAY(token_buf);
|
||||
FREE_C_HEAP_ARRAY(pSID);
|
||||
CloseHandle(hAccessToken);
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
// close the access token.
|
||||
CloseHandle(hAccessToken);
|
||||
FREE_C_HEAP_ARRAY(char, token_buf);
|
||||
FREE_C_HEAP_ARRAY(token_buf);
|
||||
|
||||
return pSID;
|
||||
}
|
||||
@ -865,7 +865,7 @@ static bool add_allow_aces(PSECURITY_DESCRIPTOR pSD,
|
||||
|
||||
if (!InitializeAcl(newACL, newACLsize, ACL_REVISION)) {
|
||||
log_debug(perf)("InitializeAcl failure: lasterror = %d", GetLastError());
|
||||
FREE_C_HEAP_ARRAY(char, newACL);
|
||||
FREE_C_HEAP_ARRAY(newACL);
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -876,7 +876,7 @@ static bool add_allow_aces(PSECURITY_DESCRIPTOR pSD,
|
||||
LPVOID ace;
|
||||
if (!GetAce(oldACL, ace_index, &ace)) {
|
||||
log_debug(perf)("InitializeAcl failure: lasterror = %d", GetLastError());
|
||||
FREE_C_HEAP_ARRAY(char, newACL);
|
||||
FREE_C_HEAP_ARRAY(newACL);
|
||||
return false;
|
||||
}
|
||||
if (((ACCESS_ALLOWED_ACE *)ace)->Header.AceFlags && INHERITED_ACE) {
|
||||
@ -901,7 +901,7 @@ static bool add_allow_aces(PSECURITY_DESCRIPTOR pSD,
|
||||
if (!AddAce(newACL, ACL_REVISION, MAXDWORD, ace,
|
||||
((PACE_HEADER)ace)->AceSize)) {
|
||||
log_debug(perf)("AddAce failure: lasterror = %d", GetLastError());
|
||||
FREE_C_HEAP_ARRAY(char, newACL);
|
||||
FREE_C_HEAP_ARRAY(newACL);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@ -915,7 +915,7 @@ static bool add_allow_aces(PSECURITY_DESCRIPTOR pSD,
|
||||
aces[i].mask, aces[i].pSid)) {
|
||||
log_debug(perf)("AddAccessAllowedAce failure: lasterror = %d",
|
||||
GetLastError());
|
||||
FREE_C_HEAP_ARRAY(char, newACL);
|
||||
FREE_C_HEAP_ARRAY(newACL);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@ -928,13 +928,13 @@ static bool add_allow_aces(PSECURITY_DESCRIPTOR pSD,
|
||||
LPVOID ace;
|
||||
if (!GetAce(oldACL, ace_index, &ace)) {
|
||||
log_debug(perf)("InitializeAcl failure: lasterror = %d", GetLastError());
|
||||
FREE_C_HEAP_ARRAY(char, newACL);
|
||||
FREE_C_HEAP_ARRAY(newACL);
|
||||
return false;
|
||||
}
|
||||
if (!AddAce(newACL, ACL_REVISION, MAXDWORD, ace,
|
||||
((PACE_HEADER)ace)->AceSize)) {
|
||||
log_debug(perf)("AddAce failure: lasterror = %d", GetLastError());
|
||||
FREE_C_HEAP_ARRAY(char, newACL);
|
||||
FREE_C_HEAP_ARRAY(newACL);
|
||||
return false;
|
||||
}
|
||||
ace_index++;
|
||||
@ -944,7 +944,7 @@ static bool add_allow_aces(PSECURITY_DESCRIPTOR pSD,
|
||||
// add the new ACL to the security descriptor.
|
||||
if (!SetSecurityDescriptorDacl(pSD, TRUE, newACL, FALSE)) {
|
||||
log_debug(perf)("SetSecurityDescriptorDacl failure: lasterror = %d", GetLastError());
|
||||
FREE_C_HEAP_ARRAY(char, newACL);
|
||||
FREE_C_HEAP_ARRAY(newACL);
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -952,7 +952,7 @@ static bool add_allow_aces(PSECURITY_DESCRIPTOR pSD,
|
||||
// protected prevents that.
|
||||
if (!SetSecurityDescriptorControl(pSD, SE_DACL_PROTECTED, SE_DACL_PROTECTED)) {
|
||||
log_debug(perf)("SetSecurityDescriptorControl failure: lasterror = %d", GetLastError());
|
||||
FREE_C_HEAP_ARRAY(char, newACL);
|
||||
FREE_C_HEAP_ARRAY(newACL);
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -1057,7 +1057,7 @@ static LPSECURITY_ATTRIBUTES make_user_everybody_admin_security_attr(
|
||||
// create a security attributes structure with access control
|
||||
// entries as initialized above.
|
||||
LPSECURITY_ATTRIBUTES lpSA = make_security_attr(aces, 3);
|
||||
FREE_C_HEAP_ARRAY(char, aces[0].pSid);
|
||||
FREE_C_HEAP_ARRAY(aces[0].pSid);
|
||||
FreeSid(everybodySid);
|
||||
FreeSid(administratorsSid);
|
||||
return(lpSA);
|
||||
@ -1341,8 +1341,8 @@ static char* mapping_create_shared(size_t size) {
|
||||
|
||||
// check that the file system is secure - i.e. it supports ACLs.
|
||||
if (!is_filesystem_secure(dirname)) {
|
||||
FREE_C_HEAP_ARRAY(char, dirname);
|
||||
FREE_C_HEAP_ARRAY(char, user);
|
||||
FREE_C_HEAP_ARRAY(dirname);
|
||||
FREE_C_HEAP_ARRAY(user);
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
@ -1358,15 +1358,15 @@ static char* mapping_create_shared(size_t size) {
|
||||
assert(((size != 0) && (size % os::vm_page_size() == 0)),
|
||||
"unexpected PerfMemry region size");
|
||||
|
||||
FREE_C_HEAP_ARRAY(char, user);
|
||||
FREE_C_HEAP_ARRAY(user);
|
||||
|
||||
// create the shared memory resources
|
||||
sharedmem_fileMapHandle =
|
||||
create_sharedmem_resources(dirname, filename, objectname, size);
|
||||
|
||||
FREE_C_HEAP_ARRAY(char, filename);
|
||||
FREE_C_HEAP_ARRAY(char, objectname);
|
||||
FREE_C_HEAP_ARRAY(char, dirname);
|
||||
FREE_C_HEAP_ARRAY(filename);
|
||||
FREE_C_HEAP_ARRAY(objectname);
|
||||
FREE_C_HEAP_ARRAY(dirname);
|
||||
|
||||
if (sharedmem_fileMapHandle == nullptr) {
|
||||
return nullptr;
|
||||
@ -1480,8 +1480,8 @@ static void open_file_mapping(int vmid, char** addrp, size_t* sizep, TRAPS) {
|
||||
// store file, we also don't following them when attaching
|
||||
//
|
||||
if (!is_directory_secure(dirname)) {
|
||||
FREE_C_HEAP_ARRAY(char, dirname);
|
||||
FREE_C_HEAP_ARRAY(char, luser);
|
||||
FREE_C_HEAP_ARRAY(dirname);
|
||||
FREE_C_HEAP_ARRAY(luser);
|
||||
THROW_MSG(vmSymbols::java_lang_IllegalArgumentException(),
|
||||
"Process not found");
|
||||
}
|
||||
@ -1498,10 +1498,10 @@ static void open_file_mapping(int vmid, char** addrp, size_t* sizep, TRAPS) {
|
||||
char* robjectname = ResourceArea::strdup(THREAD, objectname);
|
||||
|
||||
// free the c heap resources that are no longer needed
|
||||
FREE_C_HEAP_ARRAY(char, luser);
|
||||
FREE_C_HEAP_ARRAY(char, dirname);
|
||||
FREE_C_HEAP_ARRAY(char, filename);
|
||||
FREE_C_HEAP_ARRAY(char, objectname);
|
||||
FREE_C_HEAP_ARRAY(luser);
|
||||
FREE_C_HEAP_ARRAY(dirname);
|
||||
FREE_C_HEAP_ARRAY(filename);
|
||||
FREE_C_HEAP_ARRAY(objectname);
|
||||
|
||||
size_t size;
|
||||
if (*sizep == 0) {
|
||||
|
||||
@ -417,7 +417,7 @@ void CodeSection::expand_locs(int new_capacity) {
|
||||
new_capacity = old_capacity * 2;
|
||||
relocInfo* locs_start;
|
||||
if (_locs_own) {
|
||||
locs_start = REALLOC_RESOURCE_ARRAY(relocInfo, _locs_start, old_capacity, new_capacity);
|
||||
locs_start = REALLOC_RESOURCE_ARRAY(_locs_start, old_capacity, new_capacity);
|
||||
} else {
|
||||
locs_start = NEW_RESOURCE_ARRAY(relocInfo, new_capacity);
|
||||
Copy::conjoint_jbytes(_locs_start, locs_start, old_capacity * sizeof(relocInfo));
|
||||
|
||||
@ -797,7 +797,7 @@ void AOTStreamedHeapLoader::cleanup() {
|
||||
Universe::vm_global()->release(&handles[num_null_handles], num_handles - num_null_handles);
|
||||
}
|
||||
|
||||
FREE_C_HEAP_ARRAY(void*, _object_index_to_heap_object_table);
|
||||
FREE_C_HEAP_ARRAY(_object_index_to_heap_object_table);
|
||||
|
||||
// Unmap regions
|
||||
FileMapInfo::current_info()->unmap_region(AOTMetaspace::hp);
|
||||
|
||||
@ -1171,7 +1171,7 @@ void ArchiveBuilder::write_archive(FileMapInfo* mapinfo, AOTMappedHeapInfo* mapp
|
||||
AOTMapLogger::dumptime_log(this, mapinfo, mapped_heap_info, streamed_heap_info, bitmap, bitmap_size_in_bytes);
|
||||
}
|
||||
CDS_JAVA_HEAP_ONLY(HeapShared::destroy_archived_object_cache());
|
||||
FREE_C_HEAP_ARRAY(char, bitmap);
|
||||
FREE_C_HEAP_ARRAY(bitmap);
|
||||
}
|
||||
|
||||
void ArchiveBuilder::write_region(FileMapInfo* mapinfo, int region_idx, DumpRegion* dump_region, bool read_only, bool allow_exec) {
|
||||
|
||||
@ -520,7 +520,7 @@ static void substitute_aot_filename(JVMFlagsEnum flag_enum) {
|
||||
JVMFlag::Error err = JVMFlagAccess::set_ccstr(flag, &new_filename, JVMFlagOrigin::ERGONOMIC);
|
||||
assert(err == JVMFlag::SUCCESS, "must never fail");
|
||||
}
|
||||
FREE_C_HEAP_ARRAY(char, new_filename);
|
||||
FREE_C_HEAP_ARRAY(new_filename);
|
||||
}
|
||||
|
||||
void CDSConfig::check_aotmode_record() {
|
||||
|
||||
@ -49,7 +49,7 @@ void ClassListWriter::init() {
|
||||
_classlist_file->print_cr("# This file is generated via the -XX:DumpLoadedClassList=<class_list_file> option");
|
||||
_classlist_file->print_cr("# and is used at CDS archive dump time (see -Xshare:dump).");
|
||||
_classlist_file->print_cr("#");
|
||||
FREE_C_HEAP_ARRAY(char, list_name);
|
||||
FREE_C_HEAP_ARRAY(list_name);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -402,7 +402,7 @@ public:
|
||||
|
||||
~FileHeaderHelper() {
|
||||
if (_header != nullptr) {
|
||||
FREE_C_HEAP_ARRAY(char, _header);
|
||||
FREE_C_HEAP_ARRAY(_header);
|
||||
}
|
||||
if (_fd != -1) {
|
||||
::close(_fd);
|
||||
|
||||
@ -600,7 +600,7 @@ class CompileReplay : public StackObj {
|
||||
_nesting.check(); // Check if a reallocation in the resource arena is safe
|
||||
int new_length = _buffer_length * 2;
|
||||
// Next call will throw error in case of OOM.
|
||||
_buffer = REALLOC_RESOURCE_ARRAY(char, _buffer, _buffer_length, new_length);
|
||||
_buffer = REALLOC_RESOURCE_ARRAY(_buffer, _buffer_length, new_length);
|
||||
_buffer_length = new_length;
|
||||
}
|
||||
if (c == '\n') {
|
||||
|
||||
@ -2363,8 +2363,8 @@ Method* ClassFileParser::parse_method(const ClassFileStream* const cfs,
|
||||
}
|
||||
if (lvt_cnt == max_lvt_cnt) {
|
||||
max_lvt_cnt <<= 1;
|
||||
localvariable_table_length = REALLOC_RESOURCE_ARRAY(u2, localvariable_table_length, lvt_cnt, max_lvt_cnt);
|
||||
localvariable_table_start = REALLOC_RESOURCE_ARRAY(const unsafe_u2*, localvariable_table_start, lvt_cnt, max_lvt_cnt);
|
||||
localvariable_table_length = REALLOC_RESOURCE_ARRAY(localvariable_table_length, lvt_cnt, max_lvt_cnt);
|
||||
localvariable_table_start = REALLOC_RESOURCE_ARRAY(localvariable_table_start, lvt_cnt, max_lvt_cnt);
|
||||
}
|
||||
localvariable_table_start[lvt_cnt] =
|
||||
parse_localvariable_table(cfs,
|
||||
@ -2393,8 +2393,8 @@ Method* ClassFileParser::parse_method(const ClassFileStream* const cfs,
|
||||
// Parse local variable type table
|
||||
if (lvtt_cnt == max_lvtt_cnt) {
|
||||
max_lvtt_cnt <<= 1;
|
||||
localvariable_type_table_length = REALLOC_RESOURCE_ARRAY(u2, localvariable_type_table_length, lvtt_cnt, max_lvtt_cnt);
|
||||
localvariable_type_table_start = REALLOC_RESOURCE_ARRAY(const unsafe_u2*, localvariable_type_table_start, lvtt_cnt, max_lvtt_cnt);
|
||||
localvariable_type_table_length = REALLOC_RESOURCE_ARRAY(localvariable_type_table_length, lvtt_cnt, max_lvtt_cnt);
|
||||
localvariable_type_table_start = REALLOC_RESOURCE_ARRAY(localvariable_type_table_start, lvtt_cnt, max_lvtt_cnt);
|
||||
}
|
||||
localvariable_type_table_start[lvtt_cnt] =
|
||||
parse_localvariable_table(cfs,
|
||||
|
||||
@ -251,7 +251,7 @@ const char* ClassPathEntry::copy_path(const char* path) {
|
||||
}
|
||||
|
||||
ClassPathDirEntry::~ClassPathDirEntry() {
|
||||
FREE_C_HEAP_ARRAY(char, _dir);
|
||||
FREE_C_HEAP_ARRAY(_dir);
|
||||
}
|
||||
|
||||
ClassFileStream* ClassPathDirEntry::open_stream(JavaThread* current, const char* name) {
|
||||
@ -280,7 +280,7 @@ ClassFileStream* ClassPathDirEntry::open_stream(JavaThread* current, const char*
|
||||
#ifdef ASSERT
|
||||
// Freeing path is a no-op here as buffer prevents it from being reclaimed. But we keep it for
|
||||
// debug builds so that we guard against use-after-free bugs.
|
||||
FREE_RESOURCE_ARRAY_IN_THREAD(current, char, path, path_len);
|
||||
FREE_RESOURCE_ARRAY_IN_THREAD(current, path, path_len);
|
||||
#endif
|
||||
// We don't verify the length of the classfile stream fits in an int, but this is the
|
||||
// bootloader so we have control of this.
|
||||
@ -291,7 +291,7 @@ ClassFileStream* ClassPathDirEntry::open_stream(JavaThread* current, const char*
|
||||
}
|
||||
}
|
||||
}
|
||||
FREE_RESOURCE_ARRAY_IN_THREAD(current, char, path, path_len);
|
||||
FREE_RESOURCE_ARRAY_IN_THREAD(current, path, path_len);
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
@ -302,7 +302,7 @@ ClassPathZipEntry::ClassPathZipEntry(jzfile* zip, const char* zip_name) : ClassP
|
||||
|
||||
ClassPathZipEntry::~ClassPathZipEntry() {
|
||||
ZipLibrary::close(_zip);
|
||||
FREE_C_HEAP_ARRAY(char, _zip_name);
|
||||
FREE_C_HEAP_ARRAY(_zip_name);
|
||||
}
|
||||
|
||||
bool ClassPathZipEntry::has_entry(JavaThread* current, const char* name) {
|
||||
@ -1438,7 +1438,7 @@ bool ClassLoader::is_module_observable(const char* module_name) {
|
||||
struct stat st;
|
||||
const char *path = get_exploded_module_path(module_name, true);
|
||||
bool res = os::stat(path, &st) == 0;
|
||||
FREE_C_HEAP_ARRAY(char, path);
|
||||
FREE_C_HEAP_ARRAY(path);
|
||||
return res;
|
||||
}
|
||||
jlong size;
|
||||
|
||||
@ -69,7 +69,7 @@ CompactHashtableWriter::~CompactHashtableWriter() {
|
||||
delete bucket;
|
||||
}
|
||||
|
||||
FREE_C_HEAP_ARRAY(GrowableArray<Entry>*, _buckets);
|
||||
FREE_C_HEAP_ARRAY(_buckets);
|
||||
}
|
||||
|
||||
// Add an entry to the temporary hash table
|
||||
|
||||
@ -114,15 +114,15 @@ ResolutionErrorEntry::~ResolutionErrorEntry() {
|
||||
Symbol::maybe_decrement_refcount(_cause);
|
||||
|
||||
if (_message != nullptr) {
|
||||
FREE_C_HEAP_ARRAY(char, _message);
|
||||
FREE_C_HEAP_ARRAY(_message);
|
||||
}
|
||||
|
||||
if (_cause_msg != nullptr) {
|
||||
FREE_C_HEAP_ARRAY(char, _cause_msg);
|
||||
FREE_C_HEAP_ARRAY(_cause_msg);
|
||||
}
|
||||
|
||||
if (nest_host_error() != nullptr) {
|
||||
FREE_C_HEAP_ARRAY(char, nest_host_error());
|
||||
FREE_C_HEAP_ARRAY(nest_host_error());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -876,7 +876,7 @@ bool AOTCodeCache::finish_write() {
|
||||
current += size;
|
||||
uint n = write_bytes(&(entries_address[i]), sizeof(AOTCodeEntry));
|
||||
if (n != sizeof(AOTCodeEntry)) {
|
||||
FREE_C_HEAP_ARRAY(uint, search);
|
||||
FREE_C_HEAP_ARRAY(search);
|
||||
return false;
|
||||
}
|
||||
search[entries_count*2 + 0] = entries_address[i].id();
|
||||
@ -897,7 +897,7 @@ bool AOTCodeCache::finish_write() {
|
||||
}
|
||||
if (entries_count == 0) {
|
||||
log_info(aot, codecache, exit)("AOT Code Cache was not created: no entires");
|
||||
FREE_C_HEAP_ARRAY(uint, search);
|
||||
FREE_C_HEAP_ARRAY(search);
|
||||
return true; // Nothing to write
|
||||
}
|
||||
assert(entries_count <= store_count, "%d > %d", entries_count, store_count);
|
||||
@ -913,7 +913,7 @@ bool AOTCodeCache::finish_write() {
|
||||
qsort(search, entries_count, 2*sizeof(uint), uint_cmp);
|
||||
search_size = 2 * entries_count * sizeof(uint);
|
||||
copy_bytes((const char*)search, (address)current, search_size);
|
||||
FREE_C_HEAP_ARRAY(uint, search);
|
||||
FREE_C_HEAP_ARRAY(search);
|
||||
current += search_size;
|
||||
|
||||
// Write entries
|
||||
|
||||
@ -252,7 +252,7 @@ private:
|
||||
public:
|
||||
AOTStubData(BlobId blob_id) NOT_CDS({});
|
||||
|
||||
~AOTStubData() CDS_ONLY({FREE_C_HEAP_ARRAY(StubAddrRange, _ranges);}) NOT_CDS({})
|
||||
~AOTStubData() CDS_ONLY({FREE_C_HEAP_ARRAY(_ranges);}) NOT_CDS({})
|
||||
|
||||
bool is_open() CDS_ONLY({ return (_flags & OPEN) != 0; }) NOT_CDS_RETURN_(false);
|
||||
bool is_using() CDS_ONLY({ return (_flags & USING) != 0; }) NOT_CDS_RETURN_(false);
|
||||
|
||||
@ -1715,7 +1715,7 @@ void CodeCache::print_internals() {
|
||||
}
|
||||
}
|
||||
|
||||
FREE_C_HEAP_ARRAY(int, buckets);
|
||||
FREE_C_HEAP_ARRAY(buckets);
|
||||
print_memory_overhead();
|
||||
}
|
||||
|
||||
|
||||
@ -32,7 +32,7 @@ void ExceptionHandlerTable::add_entry(HandlerTableEntry entry) {
|
||||
// not enough space => grow the table (amortized growth, double its size)
|
||||
guarantee(_size > 0, "no space allocated => cannot grow the table since it is part of nmethod");
|
||||
int new_size = _size * 2;
|
||||
_table = REALLOC_RESOURCE_ARRAY(HandlerTableEntry, _table, _size, new_size);
|
||||
_table = REALLOC_RESOURCE_ARRAY(_table, _size, new_size);
|
||||
_size = new_size;
|
||||
}
|
||||
assert(_length < _size, "sanity check");
|
||||
@ -178,7 +178,7 @@ void ImplicitExceptionTable::append( uint exec_off, uint cont_off ) {
|
||||
if (_size == 0) _size = 4;
|
||||
_size *= 2;
|
||||
uint new_size_in_elements = _size*2;
|
||||
_data = REALLOC_RESOURCE_ARRAY(uint, _data, old_size_in_elements, new_size_in_elements);
|
||||
_data = REALLOC_RESOURCE_ARRAY(_data, old_size_in_elements, new_size_in_elements);
|
||||
}
|
||||
*(adr(l) ) = exec_off;
|
||||
*(adr(l)+1) = cont_off;
|
||||
|
||||
@ -36,7 +36,7 @@ void CHeapStringHolder::set(const char* string) {
|
||||
|
||||
void CHeapStringHolder::clear() {
|
||||
if (_string != nullptr) {
|
||||
FREE_C_HEAP_ARRAY(char, _string);
|
||||
FREE_C_HEAP_ARRAY(_string);
|
||||
_string = nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
@ -487,7 +487,7 @@ public:
|
||||
|
||||
void clean_details() {
|
||||
if (_detail_stats != nullptr) {
|
||||
FREE_C_HEAP_ARRAY(Details, _detail_stats);
|
||||
FREE_C_HEAP_ARRAY(_detail_stats);
|
||||
_detail_stats = nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
@ -64,8 +64,8 @@ CompileLog::~CompileLog() {
|
||||
_out = nullptr;
|
||||
// Remove partial file after merging in CompileLog::finish_log_on_error
|
||||
unlink(_file);
|
||||
FREE_C_HEAP_ARRAY(char, _identities);
|
||||
FREE_C_HEAP_ARRAY(char, _file);
|
||||
FREE_C_HEAP_ARRAY(_identities);
|
||||
FREE_C_HEAP_ARRAY(_file);
|
||||
}
|
||||
|
||||
|
||||
@ -96,7 +96,7 @@ int CompileLog::identify(ciBaseObject* obj) {
|
||||
if (id >= _identities_capacity) {
|
||||
int new_cap = _identities_capacity * 2;
|
||||
if (new_cap <= id) new_cap = id + 100;
|
||||
_identities = REALLOC_C_HEAP_ARRAY(char, _identities, new_cap, mtCompiler);
|
||||
_identities = REALLOC_C_HEAP_ARRAY(_identities, new_cap, mtCompiler);
|
||||
_identities_capacity = new_cap;
|
||||
}
|
||||
while (id >= _identities_limit) {
|
||||
|
||||
@ -256,7 +256,7 @@ ControlIntrinsicIter::ControlIntrinsicIter(ccstrlist option_value, bool disable_
|
||||
}
|
||||
|
||||
ControlIntrinsicIter::~ControlIntrinsicIter() {
|
||||
FREE_C_HEAP_ARRAY(char, _list);
|
||||
FREE_C_HEAP_ARRAY(_list);
|
||||
}
|
||||
|
||||
// pre-increment
|
||||
|
||||
@ -283,7 +283,7 @@ class ControlIntrinsicValidator {
|
||||
|
||||
~ControlIntrinsicValidator() {
|
||||
if (_bad != nullptr) {
|
||||
FREE_C_HEAP_ARRAY(char, _bad);
|
||||
FREE_C_HEAP_ARRAY(_bad);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -198,7 +198,7 @@ bool DirectivesParser::push_key(const char* str, size_t len) {
|
||||
strncpy(s, str, len);
|
||||
s[len] = '\0';
|
||||
error(KEY_ERROR, "No such key: '%s'.", s);
|
||||
FREE_C_HEAP_ARRAY(char, s);
|
||||
FREE_C_HEAP_ARRAY(s);
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -370,7 +370,7 @@ bool DirectivesParser::set_option_flag(JSON_TYPE t, JSON_VAL* v, const key* opti
|
||||
#endif
|
||||
|
||||
if (!valid) {
|
||||
FREE_C_HEAP_ARRAY(char, s);
|
||||
FREE_C_HEAP_ARRAY(s);
|
||||
return false;
|
||||
}
|
||||
(set->*test)((void *)&s); // Takes ownership.
|
||||
@ -440,7 +440,7 @@ bool DirectivesParser::set_option(JSON_TYPE t, JSON_VAL* v) {
|
||||
assert (error_msg != nullptr, "Must have valid error message");
|
||||
error(VALUE_ERROR, "Method pattern error: %s", error_msg);
|
||||
}
|
||||
FREE_C_HEAP_ARRAY(char, s);
|
||||
FREE_C_HEAP_ARRAY(s);
|
||||
}
|
||||
break;
|
||||
|
||||
@ -472,7 +472,7 @@ bool DirectivesParser::set_option(JSON_TYPE t, JSON_VAL* v) {
|
||||
error(VALUE_ERROR, "Method pattern error: %s", error_msg);
|
||||
}
|
||||
}
|
||||
FREE_C_HEAP_ARRAY(char, s);
|
||||
FREE_C_HEAP_ARRAY(s);
|
||||
}
|
||||
break;
|
||||
|
||||
@ -622,4 +622,3 @@ bool DirectivesParser::callback(JSON_TYPE t, JSON_VAL* v, uint rlimit) {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -869,7 +869,7 @@ ImmutableOopMapSet* ImmutableOopMapSet::clone() const {
|
||||
}
|
||||
|
||||
void ImmutableOopMapSet::operator delete(void* p) {
|
||||
FREE_C_HEAP_ARRAY(unsigned char, p);
|
||||
FREE_C_HEAP_ARRAY(p);
|
||||
}
|
||||
|
||||
//------------------------------DerivedPointerTable---------------------------
|
||||
|
||||
@ -70,7 +70,7 @@ public:
|
||||
}
|
||||
|
||||
~EpsilonSpaceCounters() {
|
||||
FREE_C_HEAP_ARRAY(char, _name_space);
|
||||
FREE_C_HEAP_ARRAY(_name_space);
|
||||
}
|
||||
|
||||
inline void update_all(size_t capacity, size_t used) {
|
||||
|
||||
@ -63,8 +63,8 @@ G1Allocator::~G1Allocator() {
|
||||
_mutator_alloc_regions[i].~MutatorAllocRegion();
|
||||
_survivor_gc_alloc_regions[i].~SurvivorGCAllocRegion();
|
||||
}
|
||||
FREE_C_HEAP_ARRAY(MutatorAllocRegion, _mutator_alloc_regions);
|
||||
FREE_C_HEAP_ARRAY(SurvivorGCAllocRegion, _survivor_gc_alloc_regions);
|
||||
FREE_C_HEAP_ARRAY(_mutator_alloc_regions);
|
||||
FREE_C_HEAP_ARRAY(_survivor_gc_alloc_regions);
|
||||
}
|
||||
|
||||
#ifdef ASSERT
|
||||
@ -315,7 +315,7 @@ G1PLABAllocator::PLABData::~PLABData() {
|
||||
for (uint node_index = 0; node_index < _num_alloc_buffers; node_index++) {
|
||||
delete _alloc_buffer[node_index];
|
||||
}
|
||||
FREE_C_HEAP_ARRAY(PLAB*, _alloc_buffer);
|
||||
FREE_C_HEAP_ARRAY(_alloc_buffer);
|
||||
}
|
||||
|
||||
void G1PLABAllocator::PLABData::initialize(uint num_alloc_buffers, size_t desired_plab_size, size_t tolerated_refills) {
|
||||
|
||||
@ -98,7 +98,7 @@ void G1Arguments::initialize_verification_types() {
|
||||
parse_verification_type(token);
|
||||
token = strtok_r(nullptr, delimiter, &save_ptr);
|
||||
}
|
||||
FREE_C_HEAP_ARRAY(char, type_list);
|
||||
FREE_C_HEAP_ARRAY(type_list);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -145,7 +145,7 @@ G1CardSetConfiguration::G1CardSetConfiguration(uint inline_ptr_bits_per_card,
|
||||
}
|
||||
|
||||
G1CardSetConfiguration::~G1CardSetConfiguration() {
|
||||
FREE_C_HEAP_ARRAY(size_t, _card_set_alloc_options);
|
||||
FREE_C_HEAP_ARRAY(_card_set_alloc_options);
|
||||
}
|
||||
|
||||
void G1CardSetConfiguration::init_card_set_alloc_options() {
|
||||
|
||||
@ -90,7 +90,7 @@ G1CardSetMemoryManager::~G1CardSetMemoryManager() {
|
||||
for (uint i = 0; i < num_mem_object_types(); i++) {
|
||||
_allocators[i].~G1CardSetAllocator();
|
||||
}
|
||||
FREE_C_HEAP_ARRAY(G1CardSetAllocator, _allocators);
|
||||
FREE_C_HEAP_ARRAY(_allocators);
|
||||
}
|
||||
|
||||
void G1CardSetMemoryManager::free(uint type, void* value) {
|
||||
|
||||
@ -39,7 +39,7 @@ G1CardTableClaimTable::G1CardTableClaimTable(uint chunks_per_region) :
|
||||
}
|
||||
|
||||
G1CardTableClaimTable::~G1CardTableClaimTable() {
|
||||
FREE_C_HEAP_ARRAY(uint, _card_claims);
|
||||
FREE_C_HEAP_ARRAY(_card_claims);
|
||||
}
|
||||
|
||||
void G1CardTableClaimTable::initialize(uint max_reserved_regions) {
|
||||
|
||||
@ -72,7 +72,7 @@ G1CollectionSet::G1CollectionSet(G1CollectedHeap* g1h, G1Policy* policy) :
|
||||
}
|
||||
|
||||
G1CollectionSet::~G1CollectionSet() {
|
||||
FREE_C_HEAP_ARRAY(uint, _regions);
|
||||
FREE_C_HEAP_ARRAY(_regions);
|
||||
abandon_all_candidates();
|
||||
}
|
||||
|
||||
@ -766,7 +766,7 @@ public:
|
||||
}
|
||||
}
|
||||
~G1VerifyYoungCSetIndicesClosure() {
|
||||
FREE_C_HEAP_ARRAY(int, _heap_region_indices);
|
||||
FREE_C_HEAP_ARRAY(_heap_region_indices);
|
||||
}
|
||||
|
||||
virtual bool do_heap_region(G1HeapRegion* r) {
|
||||
|
||||
@ -214,7 +214,7 @@ G1CollectionSetCandidates::G1CollectionSetCandidates() :
|
||||
{ }
|
||||
|
||||
G1CollectionSetCandidates::~G1CollectionSetCandidates() {
|
||||
FREE_C_HEAP_ARRAY(CandidateOrigin, _contains_map);
|
||||
FREE_C_HEAP_ARRAY(_contains_map);
|
||||
_from_marking_groups.clear();
|
||||
_retained_groups.clear();
|
||||
}
|
||||
@ -413,7 +413,7 @@ void G1CollectionSetCandidates::verify() {
|
||||
static_cast<std::underlying_type<CandidateOrigin>::type>(verify_map[i]));
|
||||
}
|
||||
|
||||
FREE_C_HEAP_ARRAY(CandidateOrigin, verify_map);
|
||||
FREE_C_HEAP_ARRAY(verify_map);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
@ -249,7 +249,7 @@ G1CMMarkStack::ChunkAllocator::~ChunkAllocator() {
|
||||
}
|
||||
}
|
||||
|
||||
FREE_C_HEAP_ARRAY(TaskQueueEntryChunk*, _buckets);
|
||||
FREE_C_HEAP_ARRAY(_buckets);
|
||||
}
|
||||
|
||||
bool G1CMMarkStack::ChunkAllocator::reserve(size_t new_capacity) {
|
||||
@ -676,9 +676,9 @@ void G1ConcurrentMark::reset_at_marking_complete() {
|
||||
}
|
||||
|
||||
G1ConcurrentMark::~G1ConcurrentMark() {
|
||||
FREE_C_HEAP_ARRAY(Atomic<HeapWord*>, _top_at_mark_starts);
|
||||
FREE_C_HEAP_ARRAY(Atomic<HeapWord*>, _top_at_rebuild_starts);
|
||||
FREE_C_HEAP_ARRAY(G1RegionMarkStats, _region_mark_stats);
|
||||
FREE_C_HEAP_ARRAY(_top_at_mark_starts);
|
||||
FREE_C_HEAP_ARRAY(_top_at_rebuild_starts);
|
||||
FREE_C_HEAP_ARRAY(_region_mark_stats);
|
||||
// The G1ConcurrentMark instance is never freed.
|
||||
ShouldNotReachHere();
|
||||
}
|
||||
|
||||
@ -55,7 +55,7 @@ void G1EvacFailureRegions::post_collection() {
|
||||
_regions_pinned.resize(0);
|
||||
_regions_alloc_failed.resize(0);
|
||||
|
||||
FREE_C_HEAP_ARRAY(uint, _evac_failed_regions);
|
||||
FREE_C_HEAP_ARRAY(_evac_failed_regions);
|
||||
_evac_failed_regions = nullptr;
|
||||
}
|
||||
|
||||
|
||||
@ -167,10 +167,10 @@ G1FullCollector::~G1FullCollector() {
|
||||
|
||||
delete _partial_array_state_manager;
|
||||
|
||||
FREE_C_HEAP_ARRAY(G1FullGCMarker*, _markers);
|
||||
FREE_C_HEAP_ARRAY(G1FullGCCompactionPoint*, _compaction_points);
|
||||
FREE_C_HEAP_ARRAY(Atomic<HeapWord*>, _compaction_tops);
|
||||
FREE_C_HEAP_ARRAY(G1RegionMarkStats, _live_stats);
|
||||
FREE_C_HEAP_ARRAY(_markers);
|
||||
FREE_C_HEAP_ARRAY(_compaction_points);
|
||||
FREE_C_HEAP_ARRAY(_compaction_tops);
|
||||
FREE_C_HEAP_ARRAY(_live_stats);
|
||||
}
|
||||
|
||||
class PrepareRegionsClosure : public G1HeapRegionClosure {
|
||||
|
||||
@ -718,7 +718,7 @@ G1HeapRegionClaimer::G1HeapRegionClaimer(uint n_workers) :
|
||||
}
|
||||
|
||||
G1HeapRegionClaimer::~G1HeapRegionClaimer() {
|
||||
FREE_C_HEAP_ARRAY(uint, _claims);
|
||||
FREE_C_HEAP_ARRAY(_claims);
|
||||
}
|
||||
|
||||
uint G1HeapRegionClaimer::offset_for_worker(uint worker_id) const {
|
||||
@ -759,7 +759,7 @@ public:
|
||||
for (uint worker = 0; worker < _num_workers; worker++) {
|
||||
_worker_freelists[worker].~G1FreeRegionList();
|
||||
}
|
||||
FREE_C_HEAP_ARRAY(G1FreeRegionList, _worker_freelists);
|
||||
FREE_C_HEAP_ARRAY(_worker_freelists);
|
||||
}
|
||||
|
||||
G1FreeRegionList* worker_freelist(uint worker) {
|
||||
|
||||
@ -384,7 +384,7 @@ G1FreeRegionList::NodeInfo::NodeInfo() : _numa(G1NUMA::numa()), _length_of_node(
|
||||
}
|
||||
|
||||
G1FreeRegionList::NodeInfo::~NodeInfo() {
|
||||
FREE_C_HEAP_ARRAY(uint, _length_of_node);
|
||||
FREE_C_HEAP_ARRAY(_length_of_node);
|
||||
}
|
||||
|
||||
void G1FreeRegionList::NodeInfo::clear() {
|
||||
|
||||
@ -55,8 +55,8 @@ G1HeapTransition::Data::Data(G1CollectedHeap* g1_heap) :
|
||||
}
|
||||
|
||||
G1HeapTransition::Data::~Data() {
|
||||
FREE_C_HEAP_ARRAY(uint, _eden_length_per_node);
|
||||
FREE_C_HEAP_ARRAY(uint, _survivor_length_per_node);
|
||||
FREE_C_HEAP_ARRAY(_eden_length_per_node);
|
||||
FREE_C_HEAP_ARRAY(_survivor_length_per_node);
|
||||
}
|
||||
|
||||
G1HeapTransition::G1HeapTransition(G1CollectedHeap* g1_heap) : _g1_heap(g1_heap), _before(g1_heap) { }
|
||||
|
||||
@ -52,7 +52,7 @@ void G1MonotonicArena::Segment::delete_segment(Segment* segment) {
|
||||
GlobalCounter::write_synchronize();
|
||||
}
|
||||
segment->~Segment();
|
||||
FREE_C_HEAP_ARRAY(_mem_tag, segment);
|
||||
FREE_C_HEAP_ARRAY(segment);
|
||||
}
|
||||
|
||||
void G1MonotonicArena::SegmentFreeList::bulk_add(Segment& first,
|
||||
|
||||
@ -159,7 +159,7 @@ G1MonotonicArenaFreePool::~G1MonotonicArenaFreePool() {
|
||||
for (uint i = 0; i < _num_free_lists; i++) {
|
||||
_free_lists[i].~SegmentFreeList();
|
||||
}
|
||||
FREE_C_HEAP_ARRAY(mtGC, _free_lists);
|
||||
FREE_C_HEAP_ARRAY(_free_lists);
|
||||
}
|
||||
|
||||
G1MonotonicArenaMemoryStats G1MonotonicArenaFreePool::memory_sizes() const {
|
||||
|
||||
@ -123,8 +123,8 @@ void G1NUMA::initialize(bool use_numa) {
|
||||
|
||||
G1NUMA::~G1NUMA() {
|
||||
delete _stats;
|
||||
FREE_C_HEAP_ARRAY(uint, _node_id_to_index_map);
|
||||
FREE_C_HEAP_ARRAY(uint, _node_ids);
|
||||
FREE_C_HEAP_ARRAY(_node_id_to_index_map);
|
||||
FREE_C_HEAP_ARRAY(_node_ids);
|
||||
}
|
||||
|
||||
void G1NUMA::set_region_info(size_t region_size, size_t page_size) {
|
||||
@ -280,9 +280,9 @@ G1NodeIndexCheckClosure::~G1NodeIndexCheckClosure() {
|
||||
_ls->print("%u: %u/%u/%u ", numa_ids[i], _matched[i], _mismatched[i], _total[i]);
|
||||
}
|
||||
|
||||
FREE_C_HEAP_ARRAY(uint, _matched);
|
||||
FREE_C_HEAP_ARRAY(uint, _mismatched);
|
||||
FREE_C_HEAP_ARRAY(uint, _total);
|
||||
FREE_C_HEAP_ARRAY(_matched);
|
||||
FREE_C_HEAP_ARRAY(_mismatched);
|
||||
FREE_C_HEAP_ARRAY(_total);
|
||||
}
|
||||
|
||||
bool G1NodeIndexCheckClosure::do_heap_region(G1HeapRegion* hr) {
|
||||
|
||||
@ -45,9 +45,9 @@ G1NUMAStats::NodeDataArray::NodeDataArray(uint num_nodes) {
|
||||
|
||||
G1NUMAStats::NodeDataArray::~NodeDataArray() {
|
||||
for (uint row = 0; row < _num_row; row++) {
|
||||
FREE_C_HEAP_ARRAY(size_t, _data[row]);
|
||||
FREE_C_HEAP_ARRAY(_data[row]);
|
||||
}
|
||||
FREE_C_HEAP_ARRAY(size_t*, _data);
|
||||
FREE_C_HEAP_ARRAY(_data);
|
||||
}
|
||||
|
||||
void G1NUMAStats::NodeDataArray::create_hit_rate(Stat* result) const {
|
||||
|
||||
@ -131,9 +131,9 @@ size_t G1ParScanThreadState::flush_stats(size_t* surviving_young_words, uint num
|
||||
G1ParScanThreadState::~G1ParScanThreadState() {
|
||||
delete _plab_allocator;
|
||||
delete _closures;
|
||||
FREE_C_HEAP_ARRAY(size_t, _surviving_young_words_base);
|
||||
FREE_C_HEAP_ARRAY(_surviving_young_words_base);
|
||||
delete[] _oops_into_optional_regions;
|
||||
FREE_C_HEAP_ARRAY(size_t, _obj_alloc_stat);
|
||||
FREE_C_HEAP_ARRAY(_obj_alloc_stat);
|
||||
}
|
||||
|
||||
size_t G1ParScanThreadState::lab_waste_words() const {
|
||||
@ -730,8 +730,8 @@ G1ParScanThreadStateSet::G1ParScanThreadStateSet(G1CollectedHeap* g1h,
|
||||
|
||||
G1ParScanThreadStateSet::~G1ParScanThreadStateSet() {
|
||||
assert(_flushed, "thread local state from the per thread states should have been flushed");
|
||||
FREE_C_HEAP_ARRAY(G1ParScanThreadState*, _states);
|
||||
FREE_C_HEAP_ARRAY(size_t, _surviving_young_words_total);
|
||||
FREE_C_HEAP_ARRAY(_states);
|
||||
FREE_C_HEAP_ARRAY(_surviving_young_words_total);
|
||||
}
|
||||
|
||||
#if TASKQUEUE_STATS
|
||||
|
||||
@ -38,7 +38,7 @@ G1RegionMarkStatsCache::G1RegionMarkStatsCache(G1RegionMarkStats* target, uint n
|
||||
}
|
||||
|
||||
G1RegionMarkStatsCache::~G1RegionMarkStatsCache() {
|
||||
FREE_C_HEAP_ARRAY(G1RegionMarkStatsCacheEntry, _cache);
|
||||
FREE_C_HEAP_ARRAY(_cache);
|
||||
}
|
||||
|
||||
void G1RegionMarkStatsCache::add_live_words(oop obj) {
|
||||
|
||||
@ -32,7 +32,7 @@ G1RegionsOnNodes::G1RegionsOnNodes() : _count_per_node(nullptr), _numa(G1NUMA::n
|
||||
}
|
||||
|
||||
G1RegionsOnNodes::~G1RegionsOnNodes() {
|
||||
FREE_C_HEAP_ARRAY(uint, _count_per_node);
|
||||
FREE_C_HEAP_ARRAY(_count_per_node);
|
||||
}
|
||||
|
||||
void G1RegionsOnNodes::add(G1HeapRegion* hr) {
|
||||
|
||||
@ -124,8 +124,8 @@ class G1RemSetScanState : public CHeapObj<mtGC> {
|
||||
}
|
||||
|
||||
~G1DirtyRegions() {
|
||||
FREE_C_HEAP_ARRAY(uint, _buffer);
|
||||
FREE_C_HEAP_ARRAY(Atomic<bool>, _contains);
|
||||
FREE_C_HEAP_ARRAY(_buffer);
|
||||
FREE_C_HEAP_ARRAY(_contains);
|
||||
}
|
||||
|
||||
void reset() {
|
||||
@ -245,7 +245,7 @@ public:
|
||||
_scan_top(nullptr) { }
|
||||
|
||||
~G1RemSetScanState() {
|
||||
FREE_C_HEAP_ARRAY(HeapWord*, _scan_top);
|
||||
FREE_C_HEAP_ARRAY(_scan_top);
|
||||
}
|
||||
|
||||
void initialize(uint max_reserved_regions) {
|
||||
|
||||
@ -98,7 +98,7 @@ G1RemSetSummary::G1RemSetSummary(bool should_update) :
|
||||
}
|
||||
|
||||
G1RemSetSummary::~G1RemSetSummary() {
|
||||
FREE_C_HEAP_ARRAY(jlong, _worker_threads_cpu_times);
|
||||
FREE_C_HEAP_ARRAY(_worker_threads_cpu_times);
|
||||
}
|
||||
|
||||
void G1RemSetSummary::set(G1RemSetSummary* other) {
|
||||
|
||||
@ -65,8 +65,8 @@ void G1SurvRateGroup::start_adding_regions() {
|
||||
|
||||
void G1SurvRateGroup::stop_adding_regions() {
|
||||
if (_num_added_regions > _stats_arrays_length) {
|
||||
_accum_surv_rate_pred = REALLOC_C_HEAP_ARRAY(double, _accum_surv_rate_pred, _num_added_regions, mtGC);
|
||||
_surv_rate_predictors = REALLOC_C_HEAP_ARRAY(TruncatedSeq*, _surv_rate_predictors, _num_added_regions, mtGC);
|
||||
_accum_surv_rate_pred = REALLOC_C_HEAP_ARRAY(_accum_surv_rate_pred, _num_added_regions, mtGC);
|
||||
_surv_rate_predictors = REALLOC_C_HEAP_ARRAY(_surv_rate_predictors, _num_added_regions, mtGC);
|
||||
|
||||
for (uint i = _stats_arrays_length; i < _num_added_regions; ++i) {
|
||||
// Initialize predictors and accumulated survivor rate predictions.
|
||||
|
||||
@ -802,7 +802,7 @@ public:
|
||||
for (uint worker = 0; worker < _active_workers; worker++) {
|
||||
_worker_stats[worker].~FreeCSetStats();
|
||||
}
|
||||
FREE_C_HEAP_ARRAY(FreeCSetStats, _worker_stats);
|
||||
FREE_C_HEAP_ARRAY(_worker_stats);
|
||||
|
||||
_g1h->clear_collection_set();
|
||||
|
||||
|
||||
@ -73,7 +73,7 @@ public:
|
||||
|
||||
~JavaThreadRetireTLABs() {
|
||||
static_assert(std::is_trivially_destructible<ThreadLocalAllocStats>::value, "must be");
|
||||
FREE_C_HEAP_ARRAY(ThreadLocalAllocStats, _local_tlab_stats);
|
||||
FREE_C_HEAP_ARRAY(_local_tlab_stats);
|
||||
}
|
||||
|
||||
void do_work(uint worker_id) override {
|
||||
|
||||
@ -55,7 +55,7 @@ MutableNUMASpace::MutableNUMASpace(size_t page_size) : MutableSpace(page_size) {
|
||||
lgrp_spaces()->append(new LGRPSpace(lgrp_ids[i], page_size));
|
||||
}
|
||||
|
||||
FREE_C_HEAP_ARRAY(uint, lgrp_ids);
|
||||
FREE_C_HEAP_ARRAY(lgrp_ids);
|
||||
}
|
||||
|
||||
MutableNUMASpace::~MutableNUMASpace() {
|
||||
|
||||
@ -41,7 +41,7 @@ void* BufferNode::AllocatorConfig::allocate() {
|
||||
|
||||
void BufferNode::AllocatorConfig::deallocate(void* node) {
|
||||
assert(node != nullptr, "precondition");
|
||||
FREE_C_HEAP_ARRAY(char, node);
|
||||
FREE_C_HEAP_ARRAY(node);
|
||||
}
|
||||
|
||||
BufferNode::Allocator::Allocator(const char* name, size_t buffer_capacity) :
|
||||
|
||||
@ -54,7 +54,7 @@ ClassUnloadingContext::~ClassUnloadingContext() {
|
||||
for (uint i = 0; i < _num_nmethod_unlink_workers; ++i) {
|
||||
delete _unlinked_nmethods[i];
|
||||
}
|
||||
FREE_C_HEAP_ARRAY(NMethodSet*, _unlinked_nmethods);
|
||||
FREE_C_HEAP_ARRAY(_unlinked_nmethods);
|
||||
|
||||
assert(_context == this, "context not set correctly");
|
||||
_context = nullptr;
|
||||
|
||||
@ -62,7 +62,7 @@ CollectorCounters::CollectorCounters(const char* name, int ordinal) {
|
||||
}
|
||||
|
||||
CollectorCounters::~CollectorCounters() {
|
||||
FREE_C_HEAP_ARRAY(char, _name_space);
|
||||
FREE_C_HEAP_ARRAY(_name_space);
|
||||
}
|
||||
|
||||
TraceCollectorStats::TraceCollectorStats(CollectorCounters* c) :
|
||||
|
||||
@ -64,7 +64,7 @@ GenerationCounters::GenerationCounters(const char* name,
|
||||
}
|
||||
|
||||
GenerationCounters::~GenerationCounters() {
|
||||
FREE_C_HEAP_ARRAY(char, _name_space);
|
||||
FREE_C_HEAP_ARRAY(_name_space);
|
||||
}
|
||||
|
||||
void GenerationCounters::update_capacity(size_t curr_capacity) {
|
||||
|
||||
@ -66,7 +66,7 @@ HSpaceCounters::HSpaceCounters(const char* name_space,
|
||||
}
|
||||
|
||||
HSpaceCounters::~HSpaceCounters() {
|
||||
FREE_C_HEAP_ARRAY(char, _name_space);
|
||||
FREE_C_HEAP_ARRAY(_name_space);
|
||||
}
|
||||
|
||||
void HSpaceCounters::update_capacity(size_t v) {
|
||||
|
||||
@ -136,7 +136,7 @@ OopStorage::ActiveArray* OopStorage::ActiveArray::create(size_t size,
|
||||
|
||||
void OopStorage::ActiveArray::destroy(ActiveArray* ba) {
|
||||
ba->~ActiveArray();
|
||||
FREE_C_HEAP_ARRAY(char, ba);
|
||||
FREE_C_HEAP_ARRAY(ba);
|
||||
}
|
||||
|
||||
size_t OopStorage::ActiveArray::size() const {
|
||||
@ -362,7 +362,7 @@ OopStorage::Block* OopStorage::Block::new_block(const OopStorage* owner) {
|
||||
void OopStorage::Block::delete_block(const Block& block) {
|
||||
void* memory = block._memory;
|
||||
block.Block::~Block();
|
||||
FREE_C_HEAP_ARRAY(char, memory);
|
||||
FREE_C_HEAP_ARRAY(memory);
|
||||
}
|
||||
|
||||
// This can return a false positive if ptr is not contained by some
|
||||
|
||||
@ -114,7 +114,7 @@ PartialArrayStateManager::PartialArrayStateManager(uint max_allocators)
|
||||
|
||||
PartialArrayStateManager::~PartialArrayStateManager() {
|
||||
reset();
|
||||
FREE_C_HEAP_ARRAY(Arena, _arenas);
|
||||
FREE_C_HEAP_ARRAY(_arenas);
|
||||
}
|
||||
|
||||
Arena* PartialArrayStateManager::register_allocator() {
|
||||
|
||||
@ -148,7 +148,7 @@ void PreservedMarksSet::reclaim() {
|
||||
}
|
||||
|
||||
if (_in_c_heap) {
|
||||
FREE_C_HEAP_ARRAY(Padded<PreservedMarks>, _stacks);
|
||||
FREE_C_HEAP_ARRAY(_stacks);
|
||||
} else {
|
||||
// the array was resource-allocated, so nothing to do
|
||||
}
|
||||
|
||||
@ -182,7 +182,7 @@ void StringDedup::Requests::flush() {
|
||||
assert(_storage_for_requests != nullptr, "invariant");
|
||||
_storage_for_requests->storage()->release(_buffer, _index);
|
||||
}
|
||||
FREE_C_HEAP_ARRAY(oop*, _buffer);
|
||||
FREE_C_HEAP_ARRAY(_buffer);
|
||||
_buffer = nullptr;
|
||||
}
|
||||
if (_storage_for_requests != nullptr) {
|
||||
|
||||
@ -455,7 +455,7 @@ void StringDedup::Table::free_buckets(Bucket* buckets, size_t number_of_buckets)
|
||||
while (number_of_buckets > 0) {
|
||||
buckets[--number_of_buckets].~Bucket();
|
||||
}
|
||||
FREE_C_HEAP_ARRAY(Bucket, buckets);
|
||||
FREE_C_HEAP_ARRAY(buckets);
|
||||
}
|
||||
|
||||
// Compute the hash code for obj using halfsiphash_32. As this is a high
|
||||
|
||||
@ -48,7 +48,7 @@ inline GenericTaskQueueSet<T, MT>::GenericTaskQueueSet(uint n) : _n(n) {
|
||||
|
||||
template <class T, MemTag MT>
|
||||
inline GenericTaskQueueSet<T, MT>::~GenericTaskQueueSet() {
|
||||
FREE_C_HEAP_ARRAY(T*, _queues);
|
||||
FREE_C_HEAP_ARRAY(_queues);
|
||||
}
|
||||
|
||||
#if TASKQUEUE_STATS
|
||||
|
||||
@ -72,7 +72,7 @@ WorkerDataArray<T>::~WorkerDataArray() {
|
||||
for (uint i = 0; i < MaxThreadWorkItems; i++) {
|
||||
delete _thread_work_items[i];
|
||||
}
|
||||
FREE_C_HEAP_ARRAY(T, _data);
|
||||
FREE_C_HEAP_ARRAY(_data);
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
|
||||
@ -122,7 +122,7 @@ bool SubTasksDone::try_claim_task(uint t) {
|
||||
|
||||
SubTasksDone::~SubTasksDone() {
|
||||
assert(_verification_done.load_relaxed(), "all_tasks_claimed must have been called.");
|
||||
FREE_C_HEAP_ARRAY(Atomic<bool>, _tasks);
|
||||
FREE_C_HEAP_ARRAY(_tasks);
|
||||
}
|
||||
|
||||
// *** SequentialSubTasksDone
|
||||
|
||||
@ -111,12 +111,12 @@ ShenandoahAdaptiveHeuristics::ShenandoahAdaptiveHeuristics(ShenandoahSpaceInfo*
|
||||
}
|
||||
|
||||
ShenandoahAdaptiveHeuristics::~ShenandoahAdaptiveHeuristics() {
|
||||
FREE_C_HEAP_ARRAY(double, _spike_acceleration_rate_samples);
|
||||
FREE_C_HEAP_ARRAY(double, _spike_acceleration_rate_timestamps);
|
||||
FREE_C_HEAP_ARRAY(double, _gc_time_timestamps);
|
||||
FREE_C_HEAP_ARRAY(double, _gc_time_samples);
|
||||
FREE_C_HEAP_ARRAY(double, _gc_time_xy);
|
||||
FREE_C_HEAP_ARRAY(double, _gc_time_xx);
|
||||
FREE_C_HEAP_ARRAY(_spike_acceleration_rate_samples);
|
||||
FREE_C_HEAP_ARRAY(_spike_acceleration_rate_timestamps);
|
||||
FREE_C_HEAP_ARRAY(_gc_time_timestamps);
|
||||
FREE_C_HEAP_ARRAY(_gc_time_samples);
|
||||
FREE_C_HEAP_ARRAY(_gc_time_xy);
|
||||
FREE_C_HEAP_ARRAY(_gc_time_xx);
|
||||
}
|
||||
|
||||
void ShenandoahAdaptiveHeuristics::initialize() {
|
||||
|
||||
@ -73,7 +73,7 @@ ShenandoahHeuristics::ShenandoahHeuristics(ShenandoahSpaceInfo* space_info) :
|
||||
}
|
||||
|
||||
ShenandoahHeuristics::~ShenandoahHeuristics() {
|
||||
FREE_C_HEAP_ARRAY(RegionGarbage, _region_data);
|
||||
FREE_C_HEAP_ARRAY(_region_data);
|
||||
}
|
||||
|
||||
void ShenandoahHeuristics::choose_collection_set(ShenandoahCollectionSet* collection_set) {
|
||||
|
||||
@ -70,15 +70,15 @@ ShenandoahAgeCensus::~ShenandoahAgeCensus() {
|
||||
for (uint i = 0; i < MAX_SNAPSHOTS; i++) {
|
||||
delete _global_age_tables[i];
|
||||
}
|
||||
FREE_C_HEAP_ARRAY(AgeTable*, _global_age_tables);
|
||||
FREE_C_HEAP_ARRAY(uint, _tenuring_threshold);
|
||||
CENSUS_NOISE(FREE_C_HEAP_ARRAY(ShenandoahNoiseStats, _global_noise));
|
||||
FREE_C_HEAP_ARRAY(_global_age_tables);
|
||||
FREE_C_HEAP_ARRAY(_tenuring_threshold);
|
||||
CENSUS_NOISE(FREE_C_HEAP_ARRAY(_global_noise));
|
||||
if (_local_age_tables) {
|
||||
for (uint i = 0; i < _max_workers; i++) {
|
||||
delete _local_age_tables[i];
|
||||
}
|
||||
FREE_C_HEAP_ARRAY(AgeTable*, _local_age_tables);
|
||||
CENSUS_NOISE(FREE_C_HEAP_ARRAY(ShenandoahNoiseStats, _local_noise));
|
||||
FREE_C_HEAP_ARRAY(_local_age_tables);
|
||||
CENSUS_NOISE(FREE_C_HEAP_ARRAY(_local_noise));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -261,7 +261,7 @@ void ShenandoahFullGC::do_it(GCCause::Cause gc_cause) {
|
||||
for (uint i = 0; i < heap->max_workers(); i++) {
|
||||
delete worker_slices[i];
|
||||
}
|
||||
FREE_C_HEAP_ARRAY(ShenandoahHeapRegionSet*, worker_slices);
|
||||
FREE_C_HEAP_ARRAY(worker_slices);
|
||||
|
||||
heap->set_full_gc_move_in_progress(false);
|
||||
heap->set_full_gc_in_progress(false);
|
||||
@ -688,7 +688,7 @@ void ShenandoahFullGC::distribute_slices(ShenandoahHeapRegionSet** worker_slices
|
||||
}
|
||||
}
|
||||
|
||||
FREE_C_HEAP_ARRAY(size_t, live);
|
||||
FREE_C_HEAP_ARRAY(live);
|
||||
|
||||
#ifdef ASSERT
|
||||
ResourceBitMap map(n_regions);
|
||||
|
||||
@ -77,8 +77,8 @@ ShenandoahHeapRegionCounters::ShenandoahHeapRegionCounters() :
|
||||
}
|
||||
|
||||
ShenandoahHeapRegionCounters::~ShenandoahHeapRegionCounters() {
|
||||
if (_name_space != nullptr) FREE_C_HEAP_ARRAY(char, _name_space);
|
||||
if (_regions_data != nullptr) FREE_C_HEAP_ARRAY(PerfVariable*, _regions_data);
|
||||
if (_name_space != nullptr) FREE_C_HEAP_ARRAY(_name_space);
|
||||
if (_regions_data != nullptr) FREE_C_HEAP_ARRAY(_regions_data);
|
||||
}
|
||||
|
||||
void ShenandoahHeapRegionCounters::write_snapshot(PerfLongVariable** regions,
|
||||
|
||||
@ -47,7 +47,7 @@ ShenandoahHeapRegionSet::ShenandoahHeapRegionSet() :
|
||||
}
|
||||
|
||||
ShenandoahHeapRegionSet::~ShenandoahHeapRegionSet() {
|
||||
FREE_C_HEAP_ARRAY(jbyte, _set_map);
|
||||
FREE_C_HEAP_ARRAY(_set_map);
|
||||
}
|
||||
|
||||
void ShenandoahHeapRegionSet::add_region(ShenandoahHeapRegion* r) {
|
||||
|
||||
@ -48,7 +48,7 @@ ShenandoahNMethod::ShenandoahNMethod(nmethod* nm, GrowableArray<oop*>& oops, boo
|
||||
|
||||
ShenandoahNMethod::~ShenandoahNMethod() {
|
||||
if (_oops != nullptr) {
|
||||
FREE_C_HEAP_ARRAY(oop*, _oops);
|
||||
FREE_C_HEAP_ARRAY(_oops);
|
||||
}
|
||||
}
|
||||
|
||||
@ -60,7 +60,7 @@ void ShenandoahNMethod::update() {
|
||||
detect_reloc_oops(nm(), oops, non_immediate_oops);
|
||||
if (oops.length() != _oops_count) {
|
||||
if (_oops != nullptr) {
|
||||
FREE_C_HEAP_ARRAY(oop*, _oops);
|
||||
FREE_C_HEAP_ARRAY(_oops);
|
||||
_oops = nullptr;
|
||||
}
|
||||
|
||||
@ -394,7 +394,7 @@ ShenandoahNMethodList::ShenandoahNMethodList(int size) :
|
||||
ShenandoahNMethodList::~ShenandoahNMethodList() {
|
||||
assert(_list != nullptr, "Sanity");
|
||||
assert(_ref_count == 0, "Must be");
|
||||
FREE_C_HEAP_ARRAY(ShenandoahNMethod*, _list);
|
||||
FREE_C_HEAP_ARRAY(_list);
|
||||
}
|
||||
|
||||
void ShenandoahNMethodList::transfer(ShenandoahNMethodList* const list, int limit) {
|
||||
|
||||
@ -39,10 +39,10 @@ HdrSeq::~HdrSeq() {
|
||||
for (int c = 0; c < MagBuckets; c++) {
|
||||
int* sub = _hdr[c];
|
||||
if (sub != nullptr) {
|
||||
FREE_C_HEAP_ARRAY(int, sub);
|
||||
FREE_C_HEAP_ARRAY(sub);
|
||||
}
|
||||
}
|
||||
FREE_C_HEAP_ARRAY(int*, _hdr);
|
||||
FREE_C_HEAP_ARRAY(_hdr);
|
||||
}
|
||||
|
||||
void HdrSeq::add(double val) {
|
||||
@ -191,7 +191,7 @@ BinaryMagnitudeSeq::BinaryMagnitudeSeq() {
|
||||
}
|
||||
|
||||
BinaryMagnitudeSeq::~BinaryMagnitudeSeq() {
|
||||
FREE_C_HEAP_ARRAY(size_t, _mags);
|
||||
FREE_C_HEAP_ARRAY(_mags);
|
||||
}
|
||||
|
||||
void BinaryMagnitudeSeq::clear() {
|
||||
|
||||
@ -413,7 +413,7 @@ public:
|
||||
}
|
||||
|
||||
~ShenandoahCardCluster() {
|
||||
FREE_C_HEAP_ARRAY(crossing_info, _object_starts);
|
||||
FREE_C_HEAP_ARRAY(_object_starts);
|
||||
_object_starts = nullptr;
|
||||
}
|
||||
|
||||
@ -751,7 +751,7 @@ public:
|
||||
for (uint i = 0; i < ParallelGCThreads; i++) {
|
||||
delete _card_stats[i];
|
||||
}
|
||||
FREE_C_HEAP_ARRAY(HdrSeq*, _card_stats);
|
||||
FREE_C_HEAP_ARRAY(_card_stats);
|
||||
_card_stats = nullptr;
|
||||
}
|
||||
assert(_card_stats == nullptr, "Error");
|
||||
|
||||
@ -35,7 +35,7 @@ ShenandoahSimpleBitMap::ShenandoahSimpleBitMap(idx_t num_bits) :
|
||||
|
||||
ShenandoahSimpleBitMap::~ShenandoahSimpleBitMap() {
|
||||
if (_bitmap != nullptr) {
|
||||
FREE_C_HEAP_ARRAY(uintx, _bitmap);
|
||||
FREE_C_HEAP_ARRAY(_bitmap);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -1073,7 +1073,7 @@ void ShenandoahVerifier::verify_at_safepoint(ShenandoahGeneration* generation,
|
||||
log_info(gc)("Verify %s, Level %zd (%zu reachable, %zu marked)",
|
||||
label, ShenandoahVerifyLevel, count_reachable, count_marked);
|
||||
|
||||
FREE_C_HEAP_ARRAY(ShenandoahLivenessData, ld);
|
||||
FREE_C_HEAP_ARRAY(ld);
|
||||
}
|
||||
|
||||
void ShenandoahVerifier::verify_generic(ShenandoahGeneration* generation, VerifyOption vo) {
|
||||
|
||||
@ -30,11 +30,11 @@ ZForwardingAllocator::ZForwardingAllocator()
|
||||
_top(nullptr) {}
|
||||
|
||||
ZForwardingAllocator::~ZForwardingAllocator() {
|
||||
FREE_C_HEAP_ARRAY(char, _start);
|
||||
FREE_C_HEAP_ARRAY(_start);
|
||||
}
|
||||
|
||||
void ZForwardingAllocator::reset(size_t size) {
|
||||
_start = REALLOC_C_HEAP_ARRAY(char, _start, size, mtGC);
|
||||
_start = REALLOC_C_HEAP_ARRAY(_start, size, mtGC);
|
||||
_top.store_relaxed(_start);
|
||||
_end = _start + size;
|
||||
}
|
||||
|
||||
@ -156,7 +156,7 @@ InterpreterOopMap::InterpreterOopMap() {
|
||||
InterpreterOopMap::~InterpreterOopMap() {
|
||||
if (has_valid_mask() && mask_size() > small_mask_limit) {
|
||||
assert(_bit_mask[0] != 0, "should have pointer to C heap");
|
||||
FREE_C_HEAP_ARRAY(uintptr_t, _bit_mask[0]);
|
||||
FREE_C_HEAP_ARRAY((uintptr_t*)_bit_mask[0]);
|
||||
}
|
||||
}
|
||||
|
||||
@ -288,7 +288,7 @@ void OopMapCacheEntry::deallocate_bit_mask() {
|
||||
if (mask_size() > small_mask_limit && _bit_mask[0] != 0) {
|
||||
assert(!Thread::current()->resource_area()->contains((void*)_bit_mask[0]),
|
||||
"This bit mask should not be in the resource area");
|
||||
FREE_C_HEAP_ARRAY(uintptr_t, _bit_mask[0]);
|
||||
FREE_C_HEAP_ARRAY((uintptr_t*)_bit_mask[0]);
|
||||
DEBUG_ONLY(_bit_mask[0] = 0;)
|
||||
}
|
||||
}
|
||||
|
||||
@ -528,7 +528,7 @@ const char* JfrJavaSupport::c_str(jstring string, Thread* thread, bool c_heap /*
|
||||
|
||||
void JfrJavaSupport::free_c_str(const char* str, bool c_heap) {
|
||||
if (c_heap) {
|
||||
FREE_C_HEAP_ARRAY(char, str);
|
||||
FREE_C_HEAP_ARRAY(str);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -36,7 +36,7 @@ SamplePriorityQueue::SamplePriorityQueue(size_t size) :
|
||||
}
|
||||
|
||||
SamplePriorityQueue::~SamplePriorityQueue() {
|
||||
FREE_C_HEAP_ARRAY(ObjectSample*, _items);
|
||||
FREE_C_HEAP_ARRAY(_items);
|
||||
_items = nullptr;
|
||||
}
|
||||
|
||||
|
||||
@ -46,7 +46,7 @@ static GrowableArray<InterfaceEntry>* _interfaces = nullptr;
|
||||
void JfrNetworkUtilization::destroy() {
|
||||
if (_interfaces != nullptr) {
|
||||
for (int i = 0; i < _interfaces->length(); ++i) {
|
||||
FREE_C_HEAP_ARRAY(char, _interfaces->at(i).name);
|
||||
FREE_C_HEAP_ARRAY(_interfaces->at(i).name);
|
||||
}
|
||||
delete _interfaces;
|
||||
_interfaces = nullptr;
|
||||
|
||||
@ -799,7 +799,7 @@ void JfrOptionSet::release_start_flight_recording_options() {
|
||||
if (start_flight_recording_options_array != nullptr) {
|
||||
const int length = start_flight_recording_options_array->length();
|
||||
for (int i = 0; i < length; ++i) {
|
||||
FREE_C_HEAP_ARRAY(char, start_flight_recording_options_array->at(i));
|
||||
FREE_C_HEAP_ARRAY(start_flight_recording_options_array->at(i));
|
||||
}
|
||||
delete start_flight_recording_options_array;
|
||||
start_flight_recording_options_array = nullptr;
|
||||
|
||||
@ -55,6 +55,6 @@ JfrStackFilter::~JfrStackFilter() {
|
||||
Symbol::maybe_decrement_refcount(_method_names[i]);
|
||||
Symbol::maybe_decrement_refcount(_class_names[i]);
|
||||
}
|
||||
FREE_C_HEAP_ARRAY(Symbol*, _method_names);
|
||||
FREE_C_HEAP_ARRAY(Symbol*, _class_names);
|
||||
FREE_C_HEAP_ARRAY(_method_names);
|
||||
FREE_C_HEAP_ARRAY(_class_names);
|
||||
}
|
||||
|
||||
@ -43,8 +43,8 @@ int64_t JfrStackFilterRegistry::add(jobjectArray classes, jobjectArray methods,
|
||||
Symbol** method_names = JfrJavaSupport::symbol_array(methods, jt, &m_size, true);
|
||||
assert(method_names != nullptr, "invariant");
|
||||
if (c_size != m_size) {
|
||||
FREE_C_HEAP_ARRAY(Symbol*, class_names);
|
||||
FREE_C_HEAP_ARRAY(Symbol*, method_names);
|
||||
FREE_C_HEAP_ARRAY(class_names);
|
||||
FREE_C_HEAP_ARRAY(method_names);
|
||||
JfrJavaSupport::throw_internal_error("Method array size doesn't match class array size", jt);
|
||||
return STACK_FILTER_ERROR_CODE;
|
||||
}
|
||||
|
||||
@ -51,10 +51,10 @@ JfrFilter::~JfrFilter() {
|
||||
Symbol::maybe_decrement_refcount(_method_names[i]);
|
||||
Symbol::maybe_decrement_refcount(_annotation_names[i]);
|
||||
}
|
||||
FREE_C_HEAP_ARRAY(Symbol*, _class_names);
|
||||
FREE_C_HEAP_ARRAY(Symbol*, _method_names);
|
||||
FREE_C_HEAP_ARRAY(Symbol*, _annotation_names);
|
||||
FREE_C_HEAP_ARRAY(int, _modifications);
|
||||
FREE_C_HEAP_ARRAY(_class_names);
|
||||
FREE_C_HEAP_ARRAY(_method_names);
|
||||
FREE_C_HEAP_ARRAY(_annotation_names);
|
||||
FREE_C_HEAP_ARRAY(_modifications);
|
||||
}
|
||||
|
||||
bool JfrFilter::can_instrument_module(const ModuleEntry* module) const {
|
||||
|
||||
@ -130,10 +130,10 @@ bool JfrFilterManager::install(jobjectArray classes, jobjectArray methods, jobje
|
||||
modifications[i] = modification_tah->int_at(i);
|
||||
}
|
||||
if (class_size != method_size || class_size != annotation_size || class_size != modification_size) {
|
||||
FREE_C_HEAP_ARRAY(Symbol*, class_names);
|
||||
FREE_C_HEAP_ARRAY(Symbol*, method_names);
|
||||
FREE_C_HEAP_ARRAY(Symbol*, annotation_names);
|
||||
FREE_C_HEAP_ARRAY(int, modifications);
|
||||
FREE_C_HEAP_ARRAY(class_names);
|
||||
FREE_C_HEAP_ARRAY(method_names);
|
||||
FREE_C_HEAP_ARRAY(annotation_names);
|
||||
FREE_C_HEAP_ARRAY(modifications);
|
||||
JfrJavaSupport::throw_internal_error("Method array sizes don't match", jt);
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -59,7 +59,7 @@ inline JfrConcurrentHashtable<T, IdType, TableEntry>::JfrConcurrentHashtable(uns
|
||||
|
||||
template <typename T, typename IdType, template <typename, typename> class TableEntry>
|
||||
inline JfrConcurrentHashtable<T, IdType, TableEntry>::~JfrConcurrentHashtable() {
|
||||
FREE_C_HEAP_ARRAY(Bucket, _buckets);
|
||||
FREE_C_HEAP_ARRAY(_buckets);
|
||||
}
|
||||
|
||||
template <typename T, typename IdType, template <typename, typename> class TableEntry>
|
||||
|
||||
@ -93,7 +93,7 @@ class JfrBasicHashtable : public CHeapObj<mtTracing> {
|
||||
--_number_of_entries;
|
||||
}
|
||||
void free_buckets() {
|
||||
FREE_C_HEAP_ARRAY(Bucket, _buckets);
|
||||
FREE_C_HEAP_ARRAY(_buckets);
|
||||
}
|
||||
TableEntry* bucket(size_t i) { return _buckets[i].get_entry();}
|
||||
TableEntry** bucket_addr(size_t i) { return _buckets[i].entry_addr(); }
|
||||
|
||||
@ -82,7 +82,7 @@ class JfrSetStorage : public AnyObj {
|
||||
|
||||
~JfrSetStorage() {
|
||||
if (CONFIG::alloc_type() == C_HEAP) {
|
||||
FREE_C_HEAP_ARRAY(K, _table);
|
||||
FREE_C_HEAP_ARRAY(_table);
|
||||
}
|
||||
}
|
||||
|
||||
@ -160,7 +160,7 @@ class JfrSet : public JfrSetStorage<CONFIG> {
|
||||
}
|
||||
}
|
||||
if (CONFIG::alloc_type() == AnyObj::C_HEAP) {
|
||||
FREE_C_HEAP_ARRAY(K, old_table);
|
||||
FREE_C_HEAP_ARRAY(old_table);
|
||||
}
|
||||
assert(_table_mask + 1 == this->_table_size, "invariant");
|
||||
assert(_resize_threshold << 1 == this->_table_size, "invariant");
|
||||
|
||||
@ -51,7 +51,7 @@ void VectorSet::grow(uint new_word_capacity) {
|
||||
assert(new_word_capacity < (1U << 30), "");
|
||||
uint x = next_power_of_2(new_word_capacity);
|
||||
if (x > _data_size) {
|
||||
_data = REALLOC_ARENA_ARRAY(_set_arena, uint32_t, _data, _size, x);
|
||||
_data = REALLOC_ARENA_ARRAY(_set_arena, _data, _size, x);
|
||||
_data_size = x;
|
||||
}
|
||||
Copy::zero_to_bytes(_data + _size, (x - _size) * sizeof(uint32_t));
|
||||
|
||||
@ -124,7 +124,7 @@ class AsyncLogWriter : public NonJavaThread {
|
||||
}
|
||||
|
||||
~Buffer() {
|
||||
FREE_C_HEAP_ARRAY(char, _buf);
|
||||
FREE_C_HEAP_ARRAY(_buf);
|
||||
}
|
||||
|
||||
void push_flush_token();
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user