* [Qemu-devel] [PATCH] nbd: switch from g_slice allocator to malloc
@ 2015-10-01 11:04 Paolo Bonzini
2015-10-06 14:48 ` [Qemu-devel] [Qemu-block] " Stefan Hajnoczi
0 siblings, 1 reply; 2+ messages in thread
From: Paolo Bonzini @ 2015-10-01 11:04 UTC (permalink / raw)
To: qemu-devel; +Cc: qemu-block
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>
---
nbd.c | 4 ++--
1 file 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);
--
2.5.0
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [Qemu-devel] [Qemu-block] [PATCH] nbd: switch from g_slice allocator to malloc
2015-10-01 11:04 [Qemu-devel] [PATCH] nbd: switch from g_slice allocator to malloc Paolo Bonzini
@ 2015-10-06 14:48 ` Stefan Hajnoczi
0 siblings, 0 replies; 2+ messages in thread
From: Stefan Hajnoczi @ 2015-10-06 14:48 UTC (permalink / raw)
To: Paolo Bonzini; +Cc: qemu-devel, qemu-block
On Thu, Oct 01, 2015 at 01:04:41PM +0200, Paolo Bonzini wrote:
> 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>
> ---
> nbd.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2015-10-06 14:48 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-10-01 11:04 [Qemu-devel] [PATCH] nbd: switch from g_slice allocator to malloc Paolo Bonzini
2015-10-06 14:48 ` [Qemu-devel] [Qemu-block] " Stefan Hajnoczi
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).