diff options
author | Paolo Bonzini <pbonzini@redhat.com> | 2015-10-01 13:04:39 +0200 |
---|---|---|
committer | Stefan Hajnoczi <stefanha@redhat.com> | 2015-10-12 11:17:45 +0100 |
commit | c84b31926f018af6fea2ab37a1fc47060b4bcfa1 (patch) | |
tree | c59a666dd58f626616bb85f606a347fd3bc6c1cf /block/mirror.c | |
parent | a9718ef0005d6910097788936dc40c0204713729 (diff) |
block: switch from g_slice allocator to malloc
Simplify memory allocation by sticking with a single API. GSlice
is not that fast anyway (tcmalloc/jemalloc are better).
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Diffstat (limited to 'block/mirror.c')
-rw-r--r-- | block/mirror.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/block/mirror.c b/block/mirror.c index 87928aba84..1ca4aa0da0 100644 --- a/block/mirror.c +++ b/block/mirror.c @@ -113,7 +113,7 @@ static void mirror_iteration_done(MirrorOp *op, int ret) } qemu_iovec_destroy(&op->qiov); - g_slice_free(MirrorOp, op); + g_free(op); if (s->waiting_for_io) { qemu_coroutine_enter(s->common.co, NULL); @@ -264,7 +264,7 @@ static uint64_t coroutine_fn mirror_iteration(MirrorBlockJob *s) } while (delay_ns == 0 && next_sector < end); /* Allocate a MirrorOp that is used as an AIO callback. */ - op = g_slice_new(MirrorOp); + op = g_new(MirrorOp, 1); op->s = s; op->sector_num = sector_num; op->nb_sectors = nb_sectors; |