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 6FAD8A0547; Wed, 24 Feb 2021 08:21:45 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id DF3481607A9; Wed, 24 Feb 2021 08:21:44 +0100 (CET) Received: from shelob.oktetlabs.ru (shelob.oktetlabs.ru [91.220.146.113]) by mails.dpdk.org (Postfix) with ESMTP id 54F3B4069B for ; Wed, 24 Feb 2021 08:21:43 +0100 (CET) Received: from [192.168.38.17] (aros.oktetlabs.ru [192.168.38.17]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by shelob.oktetlabs.ru (Postfix) with ESMTPSA id 773D77F4FA; Wed, 24 Feb 2021 10:21:42 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 shelob.oktetlabs.ru 773D77F4FA DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=oktetlabs.ru; s=default; t=1614151302; bh=x2yPRzycQT3Vg/Op/Rqo64JSGzejtQMccUA8Imj5neA=; h=Subject:To:Cc:References:From:Date:In-Reply-To; b=kvqPbVneN3V3i98OHWpMfrh1Dfde96v+0PsNcOCH8ZmfRC9CmpJllm1foWYbumdqa WlZi+foD/4qAdNoH4sr32Q2vCHQVjmX4wC09B8q88VUL05nuMoKt+87R1AS6S6tNHv TSj+3tCl5x9zYWP4bUmtVg4lrfZIluDtghYiPAUc= To: Nick Connolly , Dmitry Kozlyuk , dev@dpdk.org Cc: Tal Shnaiderman , Jerin Jacob , Sunil Kumar Kori References: <20210221012831.14643-1-dmitry.kozliuk@gmail.com> <20210221142819.6769-1-dmitry.kozliuk@gmail.com> <20210221142819.6769-2-dmitry.kozliuk@gmail.com> <1f95cbbf-2f89-f716-1087-0b02985d4d39@mayadata.io> From: Andrew Rybchenko Organization: OKTET Labs Message-ID: Date: Wed, 24 Feb 2021 10:21:42 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.7.1 MIME-Version: 1.0 In-Reply-To: <1f95cbbf-2f89-f716-1087-0b02985d4d39@mayadata.io> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit Subject: Re: [dpdk-dev] [PATCH v3 1/7] eal: add wrappers for POSIX string functions 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: "dev" On 2/24/21 12:53 AM, Nick Connolly wrote: > >> Allocating memory using rte_strdup() I'd use rte_free() >> to release it. I guess it will fail badly. >> So, I think that a different, more specific prefix is >> required for POSIX wrappers. > > Andrew: my understanding of Bruce's proposal is that the strdup() name > will now be kept (in this case through an inline definition), so I think > this will be ok. Very good, glad to hear it. Thanks. > However, your comment reminded me of something else > that it's probably worth mentioning as an aside: > > As a general guideline on Windows, memory allocated within a shared > library is best freed within the same DLL to ensure it goes back to the > correct heap.  So we'd want to avoid calling strdup and then returning > the value to the application for it to free (hopefully this doesn't > happen). With an inline definition there's no change in behaviour, but > adding rte_strdup (or anything else that calls malloc) into librte_eal > might be an issue. > > Regards, > Nick