提交 1729404c 编写于 作者: P Paolo Bonzini

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: NPaolo Bonzini <pbonzini@redhat.com>
上级 5451316e
......@@ -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);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册