aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaolo Bonzini <pbonzini@redhat.com>2015-10-01 12:59:08 +0200
committerPaolo Bonzini <pbonzini@redhat.com>2015-10-12 18:29:25 +0200
commit1729404c62e1adae501feeaaf61b87262d52ae1b (patch)
tree2c795e9d5743a553e937c28ad8c708c0d028288a
parent5451316ed07b758a187dedf21047bed8f843f7f1 (diff)
downloadqemu-1729404c62e1adae501feeaaf61b87262d52ae1b.zip
qemu-1729404c62e1adae501feeaaf61b87262d52ae1b.tar.gz
qemu-1729404c62e1adae501feeaaf61b87262d52ae1b.tar.bz2
nbd: 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>
-rw-r--r--nbd.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/nbd.c b/nbd.c
index 07240bd..74859cb 100644
--- a/nbd.c
+++ b/nbd.c
@@ -1005,7 +1005,7 @@ static NBDRequest *nbd_request_get(NBDClient *client)
client->nb_requests++;
nbd_update_can_read(client);
- req = g_slice_new0(NBDRequest);
+ req = g_new0(NBDRequest, 1);
nbd_client_get(client);
req->client = client;
return req;
@@ -1018,7 +1018,7 @@ static void nbd_request_put(NBDRequest *req)
if (req->data) {
qemu_vfree(req->data);
}
- g_slice_free(NBDRequest, req);
+ g_free(req);
client->nb_requests--;
nbd_update_can_read(client);