]> Git Repo - qemu.git/commitdiff
nbd: switch from g_slice allocator to malloc
authorPaolo Bonzini <[email protected]>
Thu, 1 Oct 2015 10:59:08 +0000 (12:59 +0200)
committerPaolo Bonzini <[email protected]>
Mon, 12 Oct 2015 16:29:25 +0000 (18:29 +0200)
Simplify memory allocation by sticking with a single API.  GSlice
is not that fast anyway (tcmalloc/jemalloc are better).

Signed-off-by: Paolo Bonzini <[email protected]>
nbd.c

diff --git a/nbd.c b/nbd.c
index 07240bd3e301e5b043d4c7b9e504036d76b80034..74859cbe09c0247addd24e87d387de7670667edb 100644 (file)
--- 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);
This page took 0.028265 seconds and 4 git commands to generate.