From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5333BC3DA7F for ; Thu, 15 Aug 2024 13:39:15 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id E69516B00F5; Thu, 15 Aug 2024 09:39:14 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id DF1EA6B00F6; Thu, 15 Aug 2024 09:39:14 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id CB8D66B00F7; Thu, 15 Aug 2024 09:39:14 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0010.hostedemail.com [216.40.44.10]) by kanga.kvack.org (Postfix) with ESMTP id A71326B00F5 for ; Thu, 15 Aug 2024 09:39:14 -0400 (EDT) Received: from smtpin04.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay06.hostedemail.com (Postfix) with ESMTP id 489ABA8686 for ; Thu, 15 Aug 2024 13:39:14 +0000 (UTC) X-FDA: 82454586228.04.B198CF0 Received: from mail-40133.protonmail.ch (mail-40133.protonmail.ch [185.70.40.133]) by imf22.hostedemail.com (Postfix) with ESMTP id 73940C0027 for ; Thu, 15 Aug 2024 13:39:11 +0000 (UTC) Authentication-Results: imf22.hostedemail.com; dkim=pass header.d=proton.me header.s=protonmail header.b=CCObtL38; spf=pass (imf22.hostedemail.com: domain of benno.lossin@proton.me designates 185.70.40.133 as permitted sender) smtp.mailfrom=benno.lossin@proton.me; dmarc=pass (policy=quarantine) header.from=proton.me ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1723729078; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=4KOOqAhDO4ZFOzpad7+VhAff7zaPU1/74FXUVL+elaU=; b=cm8uDKm6PQYdGvTD1wZSqfKLfrHf5dhUKyXq3f3LAn/DszNv8fbjDngKdBrI9EGFGhVOWx TtS88/EmVva6o2gubAsEUI+u2sgJ0d1OOTbRzLKOsvh7zILeqN8ndUwhZuBDefOO8QAf0J 9d0ufyoV7Zj/1134yIvZZqntjYObItc= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1723729078; a=rsa-sha256; cv=none; b=sbZ1qG62RNt4qwC6vwcrLMKfh6Dhg9qj9ZbksPKaT5f2o26MvSTRIAvR+y+O+fmVBJAjds Ly0pvOAhHj9mqIPsQMd/uhTbkqil6KE0nDo479cqzspQqJIQYyChcA6OC/bPD2lbn0pYXu CRzWwb2rQDlG5bbM8vhJ8NPsaecO/gU= ARC-Authentication-Results: i=1; imf22.hostedemail.com; dkim=pass header.d=proton.me header.s=protonmail header.b=CCObtL38; spf=pass (imf22.hostedemail.com: domain of benno.lossin@proton.me designates 185.70.40.133 as permitted sender) smtp.mailfrom=benno.lossin@proton.me; dmarc=pass (policy=quarantine) header.from=proton.me DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=proton.me; s=protonmail; t=1723729148; x=1723988348; bh=4KOOqAhDO4ZFOzpad7+VhAff7zaPU1/74FXUVL+elaU=; h=Date:To:From:Cc:Subject:Message-ID:In-Reply-To:References: Feedback-ID:From:To:Cc:Date:Subject:Reply-To:Feedback-ID: Message-ID:BIMI-Selector; b=CCObtL38d0Coq+We8Xj0kaBUjG3dRDjJIMu6fyvpjTKqgkohBsyZySwWtYFx/3Lxw M1Z4QNZkJNETFpuLe13BdAa4OJ7CHhz3OCGOG2f9J6r+FfSUTTDYdok6Gi63mkm91I hAAocKzFR6J/m9N+R4IU/JbWEM/NBqHnrsRwJPUNCkZxZQhVrpZRTqf9Xb+ajYoSYu DGfYUNqhgMN0jTnljODXYy11wZIUX3SDfyoKeOfA2m23Ut51c4v9Sqi3WNuqk7b6Sy ovSrJ5NGdOorSFnn8Uze5tEkCfjN0oBbVMe+SSdMtdnPXvy7XX6zjfbQ9gyLFFO9O6 mKqFq28FKr+/A== Date: Thu, 15 Aug 2024 13:39:05 +0000 To: Danilo Krummrich , Alice Ryhl From: Benno Lossin Cc: Boqun Feng , ojeda@kernel.org, alex.gaynor@gmail.com, wedsonaf@gmail.com, gary@garyguo.net, bjorn3_gh@protonmail.com, a.hindborg@samsung.com, akpm@linux-foundation.org, daniel.almeida@collabora.com, faith.ekstrand@collabora.com, boris.brezillon@collabora.com, lina@asahilina.net, mcanal@igalia.com, zhiw@nvidia.com, cjia@nvidia.com, jhubbard@nvidia.com, airlied@redhat.com, ajanulgu@redhat.com, lyude@redhat.com, linux-kernel@vger.kernel.org, rust-for-linux@vger.kernel.org, linux-mm@kvack.org Subject: Re: [PATCH v5 00/26] Generic `Allocator` support for Rust Message-ID: In-Reply-To: References: <20240812182355.11641-1-dakr@kernel.org> Feedback-ID: 71780778:user:proton X-Pm-Message-ID: 37da0818d01e8d58e689de0b12c5023f70729564 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Stat-Signature: rzya3zcp5yftkx8dcchd8hrkhnsgy8iy X-Rspamd-Queue-Id: 73940C0027 X-Rspam-User: X-Rspamd-Server: rspam08 X-HE-Tag: 1723729151-328487 X-HE-Meta: U2FsdGVkX1/E8+YNIOXjmPlPl7HGbXv7e1ZKKAa1wfi0lU7JMPtQK3CI4Z7tBJuScCy2BJphBLGaMCP3PKjkHstx+v92DtWwEpRqN0c2wXQAnXRQvYSdhqwwdwxzUw6lUZBZzueWmPQR0k1XK1wi4UqevOHqNu4S7B/Sl5j90y3Oz70L+3P+agmlO/Zj0O22pPaTMDUUb2/ZV3eZqZDB+Hd2Xazg51QpE6HujifV9jbbLceJhAVRgzAa0T6454hxe8I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GxK+m8qWCMMsFkpnDZSWNebG0bX1KG8swtuVGFcNjtPJb9WUeVwuktuexLlS9i0vYi0X1FL6g+Jkw6cCm X-Bogosity: Ham, tests=bogofilter, spamicity=0.001547, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: On 15.08.24 15:33, Danilo Krummrich wrote: > On Thu, Aug 15, 2024 at 02:34:50PM +0200, Alice Ryhl wrote: >> On Thu, Aug 15, 2024 at 2:33=E2=80=AFPM Danilo Krummrich wrote: >>> >>> On Thu, Aug 15, 2024 at 11:20:32AM +0200, Alice Ryhl wrote: >>>> On Thu, Aug 15, 2024 at 4:52=E2=80=AFAM Danilo Krummrich wrote: >>>>> >>>>> On Wed, Aug 14, 2024 at 12:32:15PM -0700, Boqun Feng wrote: >>>>>> Hi Danilo, >>>>>> >>>>>> I'm trying to put your series on rust-dev, but I hit a few conflicts= due >>>>>> to the conflict with `Box::drop_contents`, which has been in rust-de= v >>>>>> for a while. And the conflict is not that trivial for me to resolve. >>>>>> So just a head-up, that's a requirement for me to put it on rust-dev= for >>>>>> more tests from my end ;-) >>>>> >>>>> I rebased everything and you can fetch them from [1]. >>>>> >>>>> I resolved the following conflicts: >>>>> >>>>> - for `Box`, implement >>>>> - `drop_contents` >>>>> - `manually_drop_contents` [2] >>>> >>>> Not sure I like this name. It sounds like something that runs the >>>> destructor, but it does the exact opposite. >>> >>> I thought it kinda makes sense, since it's analogous to `ManuallyDrop::= new`. >>> >>> What about `Box::forget_contents` instead? >> >> One option is `into_manually_drop`. This uses the convention of using >> the `into_*` prefix for conversions that take ownership of the >> original value. >=20 > The signature of the current `Box::manually_drop_contents` is the same as= for > `Box::drop_contents`, namely > `fn manually_drop_contents(this: Self) -> Box, A>`. >=20 > `into_manually_drop` seems misleading for for returning a > `Box, A>`. >=20 > I still think `forget_contents` hits it quite well. Just as `drop_content= s` > drops the value, `forget_contents` makes the `Box` forget the value. I think `forget_contents` sounds good. Can you please add some more docs to that function though? Like an example and change "Manually drops the contents, but keeps the allocation" to "Forgets the contents (does not run the destructor), but keeps the allocation.". Another thing that I spotted while looking at the patch, `move_out` doesn't need the `transmute_copy`, you should be able to just call `read` on the pointer. --- Cheers, Benno