aboutsummaryrefslogtreecommitdiff
path: root/block/io.c
diff options
context:
space:
mode:
authorPaolo Bonzini <pbonzini@redhat.com>2015-10-01 13:04:39 +0200
committerStefan Hajnoczi <stefanha@redhat.com>2015-10-12 11:17:45 +0100
commitc84b31926f018af6fea2ab37a1fc47060b4bcfa1 (patch)
treec59a666dd58f626616bb85f606a347fd3bc6c1cf /block/io.c
parenta9718ef0005d6910097788936dc40c0204713729 (diff)
downloadqemu-c84b31926f018af6fea2ab37a1fc47060b4bcfa1.zip
qemu-c84b31926f018af6fea2ab37a1fc47060b4bcfa1.tar.gz
qemu-c84b31926f018af6fea2ab37a1fc47060b4bcfa1.tar.bz2
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/io.c')
-rw-r--r--block/io.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/block/io.c b/block/io.c
index 94e18e6..17293c3 100644
--- a/block/io.c
+++ b/block/io.c
@@ -2218,7 +2218,7 @@ void *qemu_aio_get(const AIOCBInfo *aiocb_info, BlockDriverState *bs,
{
BlockAIOCB *acb;
- acb = g_slice_alloc(aiocb_info->aiocb_size);
+ acb = g_malloc(aiocb_info->aiocb_size);
acb->aiocb_info = aiocb_info;
acb->bs = bs;
acb->cb = cb;
@@ -2238,7 +2238,7 @@ void qemu_aio_unref(void *p)
BlockAIOCB *acb = p;
assert(acb->refcnt > 0);
if (--acb->refcnt == 0) {
- g_slice_free1(acb->aiocb_info->aiocb_size, acb);
+ g_free(acb);
}
}