Skip to content
Snippets Groups Projects
Commit e0e18e09 authored by Moe Jette's avatar Moe Jette
Browse files

Replace X_FREE() with faster xfree()

parent 44ef78d3
No related branches found
No related tags found
No related merge requests found
......@@ -47,10 +47,6 @@ static void _slurm_free_partition_info_members (partition_info_t * part);
static void _free_all_step_info (job_step_info_response_msg_t *msg);
static void _slurm_free_job_step_info_members (job_step_info_t * msg);
#define X_FREE(_X) \
do { \
if (_X) xfree (_X); \
} while (0)
/*
* slurm_free_resource_allocation_response_msg - free slurm resource
......@@ -62,10 +58,10 @@ void slurm_free_resource_allocation_response_msg (
resource_allocation_response_msg_t * msg)
{
if (msg) {
X_FREE(msg->node_list);
X_FREE(msg->cpus_per_node);
X_FREE(msg->cpu_count_reps);
X_FREE(msg->node_addr);
xfree(msg->node_list);
xfree(msg->cpus_per_node);
xfree(msg->cpu_count_reps);
xfree(msg->node_addr);
xfree(msg);
}
}
......@@ -81,11 +77,11 @@ void slurm_free_resource_allocation_and_run_response_msg (
resource_allocation_and_run_response_msg_t * msg)
{
if (msg) {
X_FREE(msg->node_list);
X_FREE(msg->cpus_per_node);
X_FREE(msg->cpu_count_reps);
X_FREE(msg->node_addr);
X_FREE(msg->credentials);
xfree(msg->node_list);
xfree(msg->cpus_per_node);
xfree(msg->cpu_count_reps);
xfree(msg->node_addr);
xfree(msg->credentials);
# ifdef HAVE_LIBELAN3
if (msg->qsw_job)
qsw_free_jobinfo(msg->qsw_job);
......@@ -105,7 +101,7 @@ void slurm_free_job_step_create_response_msg(
job_step_create_response_msg_t * msg)
{
if (msg) {
X_FREE(msg->credentials);
xfree(msg->credentials);
# ifdef HAVE_LIBELAN3
if (msg->qsw_job)
......@@ -139,24 +135,24 @@ void slurm_free_submit_response_response_msg(submit_response_msg_t * msg)
void slurm_free_ctl_conf(slurm_ctl_conf_info_msg_t * config_ptr)
{
if (config_ptr) {
X_FREE(config_ptr->backup_addr);
X_FREE(config_ptr->backup_controller);
X_FREE(config_ptr->control_addr);
X_FREE(config_ptr->control_machine);
X_FREE(config_ptr->epilog);
X_FREE(config_ptr->job_credential_private_key);
X_FREE(config_ptr->job_credential_public_certificate);
X_FREE(config_ptr->prioritize);
X_FREE(config_ptr->prolog);
X_FREE(config_ptr->slurm_user_name);
X_FREE(config_ptr->slurmctld_pidfile);
X_FREE(config_ptr->slurmctld_logfile);
X_FREE(config_ptr->slurmd_logfile);
X_FREE(config_ptr->slurmd_pidfile);
X_FREE(config_ptr->slurmd_spooldir);
X_FREE(config_ptr->slurm_conf);
X_FREE(config_ptr->state_save_location);
X_FREE(config_ptr->tmp_fs);
xfree(config_ptr->backup_addr);
xfree(config_ptr->backup_controller);
xfree(config_ptr->control_addr);
xfree(config_ptr->control_machine);
xfree(config_ptr->epilog);
xfree(config_ptr->job_credential_private_key);
xfree(config_ptr->job_credential_public_certificate);
xfree(config_ptr->prioritize);
xfree(config_ptr->prolog);
xfree(config_ptr->slurm_user_name);
xfree(config_ptr->slurmctld_pidfile);
xfree(config_ptr->slurmctld_logfile);
xfree(config_ptr->slurmd_logfile);
xfree(config_ptr->slurmd_pidfile);
xfree(config_ptr->slurmd_spooldir);
xfree(config_ptr->slurm_conf);
xfree(config_ptr->state_save_location);
xfree(config_ptr->tmp_fs);
xfree(config_ptr);
}
}
......@@ -193,12 +189,12 @@ static void _free_all_job_info(job_info_msg_t *msg)
static void _slurm_free_job_info_members(job_info_t * job)
{
if (job) {
X_FREE(job->nodes);
X_FREE(job->partition);
X_FREE(job->name);
X_FREE(job->node_inx);
X_FREE(job->req_nodes);
X_FREE(job->features);
xfree(job->nodes);
xfree(job->partition);
xfree(job->name);
xfree(job->node_inx);
xfree(job->req_nodes);
xfree(job->features);
xfree(job->req_node_inx);
}
}
......@@ -237,8 +233,8 @@ static void _free_all_step_info (job_step_info_response_msg_t *msg)
static void _slurm_free_job_step_info_members (job_step_info_t * msg)
{
if (msg != NULL) {
X_FREE(msg->partition);
X_FREE(msg->nodes);
xfree(msg->partition);
xfree(msg->nodes);
}
}
......@@ -274,9 +270,9 @@ static void _free_all_node_info(node_info_msg_t *msg)
static void _slurm_free_node_info_members(node_info_t * node)
{
if (node) {
X_FREE(node->name);
X_FREE(node->features);
X_FREE(node->partition);
xfree(node->name);
xfree(node->features);
xfree(node->partition);
}
}
......@@ -315,10 +311,10 @@ static void _free_all_partitions(partition_info_msg_t *msg)
static void _slurm_free_partition_info_members(partition_info_t * part)
{
if (part) {
X_FREE(part->name);
X_FREE(part->allow_groups);
X_FREE(part->nodes);
X_FREE(part->node_inx);
xfree(part->name);
xfree(part->allow_groups);
xfree(part->nodes);
xfree(part->node_inx);
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment