Skip to content

Commit

Permalink
softmmu/dirtylimit: Convert free to g_free
Browse files Browse the repository at this point in the history
Convert free to g_free to match g_new and g_malloc functions.

Fixes: cc2b33e ("softmmu/dirtylimit: Implement vCPU dirtyrate calculation periodically")
Fixes: baa6098 ("softmmu/dirtylimit: Implement virtual CPU throttle")
Signed-off-by: alloc.young <alloc.young@outlook.com>
Reviewed-by: Hyman Huang <yong.huang@smartx.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Message-Id: <SA1PR11MB67604ECD85AFF34BEB3072F7F5E3A@SA1PR11MB6760.namprd11.prod.outlook.com>
Signed-off-by: Hyman Huang <yong.huang@smartx.com>
  • Loading branch information
alloc.young authored and HuangSuiXiao committed Aug 29, 2023
1 parent 58b4def commit 19b14ce
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions softmmu/dirtylimit.c
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ static void vcpu_dirty_rate_stat_collect(void)
stat.rates[i].dirty_rate;
}

free(stat.rates);
g_free(stat.rates);
}

static void *vcpu_dirty_rate_stat_thread(void *opaque)
Expand Down Expand Up @@ -171,10 +171,10 @@ void vcpu_dirty_rate_stat_initialize(void)

void vcpu_dirty_rate_stat_finalize(void)
{
free(vcpu_dirty_rate_stat->stat.rates);
g_free(vcpu_dirty_rate_stat->stat.rates);
vcpu_dirty_rate_stat->stat.rates = NULL;

free(vcpu_dirty_rate_stat);
g_free(vcpu_dirty_rate_stat);
vcpu_dirty_rate_stat = NULL;
}

Expand Down Expand Up @@ -220,10 +220,10 @@ void dirtylimit_state_initialize(void)

void dirtylimit_state_finalize(void)
{
free(dirtylimit_state->states);
g_free(dirtylimit_state->states);
dirtylimit_state->states = NULL;

free(dirtylimit_state);
g_free(dirtylimit_state);
dirtylimit_state = NULL;

trace_dirtylimit_state_finalize();
Expand Down

0 comments on commit 19b14ce

Please sign in to comment.