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 C49C9A0547; Mon, 21 Jun 2021 14:10:27 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 3EB2241158; Mon, 21 Jun 2021 14:10:27 +0200 (CEST) Received: from smartserver.smartsharesystems.com (smartserver.smartsharesystems.com [77.243.40.215]) by mails.dpdk.org (Postfix) with ESMTP id E9D9140040 for ; Mon, 21 Jun 2021 14:10:25 +0200 (CEST) Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: base64 Date: Mon, 21 Jun 2021 14:10:24 +0200 Message-ID: <98CBD80474FA8B44BF855DF32C47DC35C6187A@smartserver.smartshare.dk> In-Reply-To: X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: [dpdk-dev] [PATCH] parray: introduce internal API for dynamic arrays Thread-Index: AQHXYQxT3nKj3OToOE+g04oypCLg2asTbdkAgAAOoICAAATCgIAAFeZggAAOq/CABIvGAIAAHL6ggAAPB4CAATs50IAEplTQgAApWQA= References: <20210614105839.3379790-1-thomas@monjalon.net> <98CBD80474FA8B44BF855DF32C47DC35C6184E@smartserver.smartshare.dk> <2004320.XGyPsaEoyj@thomas> <0bb118ba-2658-a7d7-ad8f-bf27f62849f7@intel.com> X-MimeOLE: Produced By Microsoft Exchange V6.5 From: =?utf-8?B?TW9ydGVuIEJyw7hydXA=?= To: "Ananyev, Konstantin" , "Yigit, Ferruh" , "Thomas Monjalon" , "Richardson, Bruce" Cc: , , , , , Subject: Re: [dpdk-dev] [PATCH] parray: introduce internal API for dynamic arrays 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 Sender: "d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