From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:49912) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zn0iO-0003PY-Nw for qemu-devel@nongnu.org; Fri, 16 Oct 2015 04:50:20 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Zn0iN-0006te-Np for qemu-devel@nongnu.org; Fri, 16 Oct 2015 04:50:16 -0400 Received: from mx1.redhat.com ([209.132.183.28]:37270) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zn0iN-0006tV-IC for qemu-devel@nongnu.org; Fri, 16 Oct 2015 04:50:15 -0400 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (Postfix) with ESMTPS id 32C62C0BFD3A for ; Fri, 16 Oct 2015 08:50:15 +0000 (UTC) Received: from donizetti.redhat.com (ovpn-112-80.ams2.redhat.com [10.36.112.80]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id t9G8oCaM010200 for ; Fri, 16 Oct 2015 04:50:14 -0400 From: Paolo Bonzini Date: Fri, 16 Oct 2015 10:49:23 +0200 Message-Id: <1444985411-17803-2-git-send-email-pbonzini@redhat.com> In-Reply-To: <1444985411-17803-1-git-send-email-pbonzini@redhat.com> References: <1444985411-17803-1-git-send-email-pbonzini@redhat.com> Subject: [Qemu-devel] [PULL 01/49] nbd: switch from g_slice allocator to malloc List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Simplify memory allocation by sticking with a single API. GSlice is not that fast anyway (tcmalloc/jemalloc are better). Signed-off-by: Paolo Bonzini --- 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