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 /hw | |
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 'hw')
-rw-r--r-- | hw/block/virtio-blk.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/hw/block/virtio-blk.c b/hw/block/virtio-blk.c index 76d27f9376..8beb26b4db 100644 --- a/hw/block/virtio-blk.c +++ b/hw/block/virtio-blk.c @@ -30,7 +30,7 @@ VirtIOBlockReq *virtio_blk_alloc_request(VirtIOBlock *s) { - VirtIOBlockReq *req = g_slice_new(VirtIOBlockReq); + VirtIOBlockReq *req = g_new(VirtIOBlockReq, 1); req->dev = s; req->qiov.size = 0; req->in_len = 0; @@ -42,7 +42,7 @@ VirtIOBlockReq *virtio_blk_alloc_request(VirtIOBlock *s) void virtio_blk_free_request(VirtIOBlockReq *req) { if (req) { - g_slice_free(VirtIOBlockReq, req); + g_free(req); } } |