From nobody Sun Feb 8 19:03:04 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) client-ip=216.205.24.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1602159184; cv=none; d=zohomail.com; s=zohoarc; b=RkrOWMIJnI2oX+B/eRZvOTCDIi9VkKIqx+ZNCV7GLQ0f0QErwUmcLi/ijEbA+TtHb6sqzJPm1PHaFs1/Wf0gRsVArMQYt14+348RDRRxjl7sSdAGAYqN+gKl0RYSlmf0DMI9nIpjsQd8pg8K61mwzAweAFICi52oMWdIu69Im6E= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1602159184; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=1RULqST8i7r0190tov89ihntQhr7jU6YNNf9JMfGnTg=; b=X0bPOsKkjrf5QFJZ6JV2u0YwycRAYjSN9SgMoeiOv8M37EWtGelh9o+VHlCgVCWmY/MmR+L2N/G0o6y3rPUAkdueibPcxeilyGYe9PYcGwt3gx0tXpe6Mk5TGvB+qTc3xIjQhXtig9LPqGJFeifTov+CnHp9BLLd9IrI3Cv/6Kw= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by mx.zohomail.com with SMTPS id 1602159184900120.13069485448841; Thu, 8 Oct 2020 05:13:04 -0700 (PDT) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-566-sqb0DerAPEeGOggGB-Gg3Q-1; Thu, 08 Oct 2020 08:12:55 -0400 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id E0CA7900C2B; Thu, 8 Oct 2020 12:12:42 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id BA7CF61176; Thu, 8 Oct 2020 12:12:42 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 8581C1832FC2; Thu, 8 Oct 2020 12:12:42 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 098CCQAu001336 for ; Thu, 8 Oct 2020 08:12:26 -0400 Received: by smtp.corp.redhat.com (Postfix) id 79E2655764; Thu, 8 Oct 2020 12:12:26 +0000 (UTC) Received: from hjs.redhat.com (unknown [10.43.2.12]) by smtp.corp.redhat.com (Postfix) with ESMTP id D7AA855761 for ; Thu, 8 Oct 2020 12:12:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1602159183; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=1RULqST8i7r0190tov89ihntQhr7jU6YNNf9JMfGnTg=; b=cJdojlvux7RVulZGI6UyVVOk/G3OQml1Lxm4SQM9nKc62DFBehOkDrPpEdodtEIyZ2EGNB lbLk/n43cmeQareS1qVeDfLnrsdWpxaL/qki9acfBAinQDDtkp1E9ceYfi8tqZk8unpoXt tY60kxMbKAbRJY886noS6L5UAhJpaQY= X-MC-Unique: sqb0DerAPEeGOggGB-Gg3Q-1 From: =?UTF-8?q?J=C3=A1n=20Tomko?= To: libvir-list@redhat.com Subject: [libvirt PATCH 8/8] util: delete VIR_ALLOC and VIR_ALLOC_N Date: Thu, 8 Oct 2020 14:12:14 +0200 Message-Id: <8d8c4d7a6ee084ab3512a6588c35f3b67c8c5d2e.1602158901.git.jtomko@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-loop: libvir-list@redhat.com X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Signed-off-by: J=C3=A1n Tomko --- src/libvirt_private.syms | 2 -- src/util/viralloc.c | 39 --------------------------------------- src/util/viralloc.h | 33 --------------------------------- 3 files changed, 74 deletions(-) diff --git a/src/libvirt_private.syms b/src/libvirt_private.syms index 7cf8bea962..152083d220 100644 --- a/src/libvirt_private.syms +++ b/src/libvirt_private.syms @@ -1614,8 +1614,6 @@ vir_g_strdup_vprintf; =20 =20 # util/viralloc.h -virAlloc; -virAllocN; virAllocVar; virDeleteElementsN; virDispose; diff --git a/src/util/viralloc.c b/src/util/viralloc.c index e254416cdf..0360b8a8aa 100644 --- a/src/util/viralloc.c +++ b/src/util/viralloc.c @@ -31,45 +31,6 @@ VIR_LOG_INIT("util.alloc"); =20 =20 -/** - * virAlloc: - * @ptrptr: pointer to pointer for address of allocated memory - * @size: number of bytes to allocate - * - * Allocate 'size' bytes of memory. Return the address of the - * allocated memory in 'ptrptr'. The newly allocated memory is - * filled with zeros. - * - * Returns zero on success, aborts on OOM - */ -int virAlloc(void *ptrptr, - size_t size) -{ - *(void **)ptrptr =3D g_malloc0(size); - return 0; -} - -/** - * virAllocN: - * @ptrptr: pointer to pointer for address of allocated memory - * @size: number of bytes to allocate - * @count: number of elements to allocate - * - * Allocate an array of memory 'count' elements long, - * each with 'size' bytes. Return the address of the - * allocated memory in 'ptrptr'. The newly allocated - * memory is filled with zeros. - * - * Returns zero on success, aborts on OOM - */ -int virAllocN(void *ptrptr, - size_t size, - size_t count) -{ - *(void**)ptrptr =3D g_malloc0_n(count, size); - return 0; -} - /** * virReallocN: * @ptrptr: pointer to pointer for address of allocated memory diff --git a/src/util/viralloc.h b/src/util/viralloc.h index a50cd5d632..1abd94fac4 100644 --- a/src/util/viralloc.h +++ b/src/util/viralloc.h @@ -34,10 +34,6 @@ */ =20 /* Don't call these directly - use the macros below */ -int virAlloc(void *ptrptr, size_t size) - G_GNUC_WARN_UNUSED_RESULT ATTRIBUTE_NONNULL(1); -int virAllocN(void *ptrptr, size_t size, size_t count) - G_GNUC_WARN_UNUSED_RESULT ATTRIBUTE_NONNULL(1); int virReallocN(void *ptrptr, size_t size, size_t count) G_GNUC_WARN_UNUSED_RESULT ATTRIBUTE_NONNULL(1); int virExpandN(void *ptrptr, size_t size, size_t *count, size_t add) @@ -61,35 +57,6 @@ void virDispose(void *ptrptr, size_t count, size_t eleme= nt_size, size_t *countpt void virDisposeString(char **strptr) ATTRIBUTE_NONNULL(1); =20 -/** - * VIR_ALLOC: - * @ptr: pointer to hold address of allocated memory - * - * Allocate sizeof(*ptr) bytes of memory and store - * the address of allocated memory in 'ptr'. Fill the - * newly allocated memory with zeros. - * - * This macro is safe to use on arguments with side effects. - * - * Returns 0 on success, aborts on OOM - */ -#define VIR_ALLOC(ptr) virAlloc(&(ptr), sizeof(*(ptr))) - -/** - * VIR_ALLOC_N: - * @ptr: pointer to hold address of allocated memory - * @count: number of elements to allocate - * - * Allocate an array of 'count' elements, each sizeof(*ptr) - * bytes long and store the address of allocated memory in - * 'ptr'. Fill the newly allocated memory with zeros. - * - * This macro is safe to use on arguments with side effects. - * - * Returns 0 on success, aborts on OOM - */ -#define VIR_ALLOC_N(ptr, count) virAllocN(&(ptr), sizeof(*(ptr)), (count)) - /** * VIR_REALLOC_N: * @ptr: pointer to hold address of allocated memory --=20 2.26.2