From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 820CF45A7B; Tue, 1 Oct 2024 17:25:36 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 6F77040611; Tue, 1 Oct 2024 17:25:36 +0200 (CEST) Received: from mail-pl1-f181.google.com (mail-pl1-f181.google.com [209.85.214.181]) by mails.dpdk.org (Postfix) with ESMTP id 6BC6A4060B for ; Tue, 1 Oct 2024 17:25:35 +0200 (CEST) Received: by mail-pl1-f181.google.com with SMTP id d9443c01a7336-20bb92346caso4659535ad.0 for ; Tue, 01 Oct 2024 08:25:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20230601.gappssmtp.com; s=20230601; t=1727796334; x=1728401134; darn=dpdk.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:subject:cc:to:from:date:from:to:cc:subject:date :message-id:reply-to; bh=7YzdvMoQkoJV349Q6gHAE1AdDFaZNtV076pCfUc93wg=; b=ZT2gfOWorSrKUYlgwaDtU3elxWUfp/slgJrydwIyqh9yMCq/jJ+0E3Y5rZzRErML1S RA/it9OR2btuODid4B0kKGviwiMtwhnTEcnPXlhg1DqB0lhcOaPZxyWndk4SH2ZTGTvv eINw2GCChkY0fyAFRiVpEagR2aHR31b4Rfp7cHeI/bfLYPcAya9xAdt7G+dXeam9eiRv Rg0+2+Y1UaGLKkuSN3wW8P06rhIG2MLNWTGxgWnYI2hg+889VM+cpOUk2T/kkoRcM1FF da4OvPhL7raLGb5mvTOY987N8LtnA6//QsY/R55FZQtCb1QA4aWEixi0AXJW/kkTPaBl wnQg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727796334; x=1728401134; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:subject:cc:to:from:date:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=7YzdvMoQkoJV349Q6gHAE1AdDFaZNtV076pCfUc93wg=; b=nH9MzToIWxEcSHVLu4HjJ11qQEDfK6K9tL12XimleXQpVIKVOKampqY9XBm6lHH+hI 1RrZYGMA2rbzgDzKNpiu1BQcgHjx0MI9/pxiZSyRLSI+nBqGAdMjwU7IfhDRxH3qjWql a/fY2FiPymLbqQJw2LnnBYrNhFYtS6XcDPMRa711nW606rPe6mMuCO8rfJ4M127Nje5G aXk2GdALnngJ9Au1Tqw09Q7EpcGbM05M+ZZkmP3tQTaZ1jK2EnRumkYAyi5lexL59CC3 1K1fOGMuueLX7HGQ4yGXpuKrltC3Rms5sF34D/ocifZHy85FrGthz2WZVWa8APrEBccs 4CBw== X-Forwarded-Encrypted: i=1; AJvYcCWhJ47XKqOkvucAgg7Xn11xRi/YKRVZlEqtcVUrUhdxK+P7ZPljcaqKXiZabQuDuu7BL2U=@dpdk.org X-Gm-Message-State: AOJu0YwhxMyoQSn8BA6lrPvmnbUpbNJm/3Jq6kQgH/j3SRT5EVTt0krT o2Jckk1cm24OnetM/ky4zNJ9F/RuiJmW8WAejbWhryU3ZhgqFF6kSMosMFyXEMk= X-Google-Smtp-Source: AGHT+IE1xEgJHVZseuKAXy/P2XKnDhp4it/qKeTWYbmi38LEJdPylX8MOejrXHBDgWdUqgoh3rR+Sg== X-Received: by 2002:a17:903:22c9:b0:205:5d71:561e with SMTP id d9443c01a7336-20ba9f0b962mr48849785ad.26.1727796334383; Tue, 01 Oct 2024 08:25:34 -0700 (PDT) Received: from hermes.local (204-195-96-226.wavecable.com. [204.195.96.226]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-20b37d8cd70sm71011655ad.73.2024.10.01.08.25.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 01 Oct 2024 08:25:34 -0700 (PDT) Date: Tue, 1 Oct 2024 08:25:32 -0700 From: Stephen Hemminger To: David Marchand Cc: "Burakov, Anatoly" , dev@dpdk.org, Chengwen Feng , Tyler Retzlaff Subject: Re: [PATCH v4 17/17] eal: add function attributes for allocation functions Message-ID: <20241001082532.20ddeea2@hermes.local> In-Reply-To: References: <20240927204742.546164-1-stephen@networkplumber.org> <20240930184600.7092-1-stephen@networkplumber.org> <20240930184600.7092-18-stephen@networkplumber.org> <74a4fea2-5218-43a5-8f58-1d6afbd933ca@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org On Tue, 1 Oct 2024 14:25:46 +0200 David Marchand wrote: > On Tue, Oct 1, 2024 at 2:21=E2=80=AFPM Burakov, Anatoly > wrote: > > > + > > > +/** > > > + * Frees the memory space pointed to by the provided pointer. > > > + * > > > + * This pointer must have been returned by a previous call to > > > + * rte_malloc(), rte_zmalloc(), rte_calloc() or rte_realloc(). The b= ehaviour of > > > + * rte_free() is undefined if the pointer does not match this requir= ement. > > > + * > > > + * If the pointer is NULL, the function does nothing. > > > + * > > > + * @param ptr > > > + * The pointer to memory to be freed. > > > + */ > > > +void > > > +rte_free(void *ptr); > > > + =20 > > > > Is there any particular reason why rte_free was moved? > > > > Otherwise, > > > > Acked-by: Anatoly Burakov =20 >=20 > I guess this is for the added annotation which points at rte_free symbol. > A forward declaration would be another option. Right, compiler now needs to know about the free function. Moving it was the clean solution and avoids duplication. If rte_free prototype is not moved... In file included from ../lib/eal/include/rte_string_fns.h:22, from ../lib/eal/common/eal_common_config.c:5: ../lib/eal/include/rte_common.h:261:42: error: =E2=80=98rte_free=E2=80=99 u= ndeclared here (not in a function) 261 | #define __rte_dealloc_free __rte_dealloc(rte_free, 1) | ^~~~~~~~ ../lib/eal/include/rte_common.h:260:31: note: in definition of macro =E2=80= =98__rte_dealloc=E2=80=99 260 | __attribute__((malloc(dealloc, argno))) | ^~~~~~~ ../lib/eal/include/rte_malloc.h:58:22: note: in expansion of macro =E2=80= =98__rte_dealloc_free=E2=80=99 58 | __rte_malloc __rte_dealloc_free; | ^~~~~~~~~~~~~~~~~~ [16/3024] Compiling C object lib/librte_telemetry.a.p/telemetry_telemetry.c= .o