Received: by 2002:ab2:7b86:0:b0:1f7:5705:b850 with SMTP id q6csp482451lqh; Sat, 4 May 2024 08:45:41 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVkH1PVM3JrDckPj+zuWklX835dVDMHjrCBusiyVn703HqRnGg/zRiGLbvwNTGfI4kPzkPu0ZsoVE4sxD6r0U3Ban0lnM/c8WsTyiRuKQ== X-Google-Smtp-Source: AGHT+IETGYbGnggiylW6OkPkXZqhaRrNq2fFzsNwvNeP68bCwL18LmeG6nlMKa7Fr++hv6RhyBzS X-Received: by 2002:a54:4690:0:b0:3c8:61aa:377e with SMTP id k16-20020a544690000000b003c861aa377emr6106557oic.28.1714837540728; Sat, 04 May 2024 08:45:40 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1714837540; cv=pass; d=google.com; s=arc-20160816; b=MEVEPTDIApCTlY3s6pOOExMm0qyU+cFmfvh4k4vuUq8l72aK/8kpJAZUgbuNGGj/yl fQROpZhs+vZDQw1DE/368d1q9hTzc9q+pw6T5hRNeZxbJZ9AmujYx98Eno3fm07P57Tc TvpJJhU7yGK+m30Wl1SIPmDvJvZHokUaiNguoVwWYqmNzcdXtjrtnUtgU+BD6TVxALKX ATj3Ib1dE6sinF3Tpa/r/irdSBN2YxemWcAsy1d6pldDv+vMjtLMppQfK64Uwil9SfG3 15fA/z+v9Meb8h9NOz4GvPvuxHamJUZwnWyndiJ2DXw4t0LyJT4AE2YhRJ3UrnGOamIM qswg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:feedback-id:references :in-reply-to:message-id:subject:cc:from:to:date:dkim-signature; bh=ge8eSrWmG1QSzwW7t9UJrqZ0IDlqBkwqstyme4yNE5c=; fh=sUkmEM0f4r3oKclGKZ33P8W7UrrFlDDKJcB1gXqwwfI=; b=ZSIa4zmCjwyV3ZQm5QmnpR4UwDgs5TJYKkhuthcHYEQexWJCqi4ajz9qZewA0HMZ51 eAe694d0ervJHyZMXZ6Vl+xHjXQ2BPGDvtB71G6HZ4OEab5FVZQyt3gw+KlIshYqMl8r G7464zkIsIt8CnE0HlzkgDy0NUrfGb+doeUSUnS0QY6yBm7uBTuiqurb9ZPB92/UIi0q dPJCwsWPfJcyZvojxIdw5xYCTubpk63gTqhVb/euZ7FPSeCAPqjCb1a16tSWaXgVnokc Ueh9M1hV9+sEvhIbSv6I4mYMyfhK8hZA3EjaIO2IpgNm0r2CrvqaEBZsg/QoCJn2c0H5 pqnQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@proton.me header.s=protonmail header.b=Q+yaRJya; arc=pass (i=1 spf=pass spfdomain=proton.me dkim=pass dkdomain=proton.me dmarc=pass fromdomain=proton.me); spf=pass (google.com: domain of linux-kernel+bounces-168733-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-168733-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=proton.me Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id d8-20020a05621421c800b006a0b359779asi5838312qvh.567.2024.05.04.08.45.40 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 04 May 2024 08:45:40 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-168733-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@proton.me header.s=protonmail header.b=Q+yaRJya; arc=pass (i=1 spf=pass spfdomain=proton.me dkim=pass dkdomain=proton.me dmarc=pass fromdomain=proton.me); spf=pass (google.com: domain of linux-kernel+bounces-168733-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-168733-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=proton.me Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 7226C1C20EAB for ; Sat, 4 May 2024 15:45:40 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id C288F4E1C9; Sat, 4 May 2024 15:45:32 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=proton.me header.i=@proton.me header.b="Q+yaRJya" Received: from mail-4322.protonmail.ch (mail-4322.protonmail.ch [185.70.43.22]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 0091157CAE; Sat, 4 May 2024 15:45:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.70.43.22 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714837531; cv=none; b=GEn8pd4Dq58maFFMUg2lS2yN/n7+qiUgNj7iOFA/LrrAdZcTHhGrId9zz1Ivak6qicmkl6WrzxdH4e8xh3O+oxQQFPOeH69asgEeyUsNEn7nibRMc56n2RyOo44/PTrVMjmygQIl1cjLEd2Egk29MPpZhXAnySyY5sUWrHHBiW8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714837531; c=relaxed/simple; bh=ge8eSrWmG1QSzwW7t9UJrqZ0IDlqBkwqstyme4yNE5c=; h=Date:To:From:Cc:Subject:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=PK5x5AqRtJ/kjV2IPIZUm5aETYuuYjrQCrM6IL3lQbQUEN4o/yA7HmZ0HZTxDemYvVMJiI+v4YTkKNeirraeD+mzXq4k4tA0v35x7lDTWX/x+6HnJiv22ZTx33peyX2URuOFHL61b6FmY1uZnZ1+AcVX/G2DCz4qXW8i05QP+q8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=proton.me; spf=pass smtp.mailfrom=proton.me; dkim=pass (2048-bit key) header.d=proton.me header.i=@proton.me header.b=Q+yaRJya; arc=none smtp.client-ip=185.70.43.22 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=proton.me Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=proton.me DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=proton.me; s=protonmail; t=1714837519; x=1715096719; bh=ge8eSrWmG1QSzwW7t9UJrqZ0IDlqBkwqstyme4yNE5c=; 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=Q+yaRJyaOA8VLNri/LpklXLordbIb6nISYDvqFQVPGFDoEACtQkIc2cZAZRw9ijGE 8ES1G6S0zaFO92FJg+HvPXWKHqKWYe8TZ68TUsKD8W6Epz4CqhNH0bwKgAT60iDysX J3IJrRHUYqDBq0c9gWho+dvEwkTQcm+wzWKoL0ku2fOS327yzSfzcz/iiLckWLkqW5 OyiWjl1P236Jzj5Tjt/8H7Y6H+pquCdu0mW8D5edrPHd5eYWp1KcFOBeyVxNzFCaTB bdWfghiXKoSbokukpj7s5OF1SRGQF7AdTJVRElUWeDxFxN9zydRGHVC1h+XikdxEnf 5ABeX9/W6unCA== Date: Sat, 04 May 2024 15:45:09 +0000 To: Alice Ryhl From: Benno Lossin Cc: Miguel Ojeda , Alex Gaynor , Wedson Almeida Filho , Boqun Feng , Gary Guo , =?utf-8?Q?Bj=C3=B6rn_Roy_Baron?= , Andreas Hindborg , rust-for-linux@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 2/2] rust: init: add re-initialization functions Message-ID: <1fa87967-079f-4ff8-9946-81a571eb09bf@proton.me> In-Reply-To: References: <20240425213419.3904105-1-benno.lossin@proton.me> <20240425213419.3904105-2-benno.lossin@proton.me> Feedback-ID: 71780778:user:proton X-Pm-Message-ID: f67d8b7b5a8af450ba0a34fba934da2883ac5ffc Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 03.05.24 13:34, Alice Ryhl wrote: > On Thu, Apr 25, 2024 at 11:34=E2=80=AFPM Benno Lossin wrote: >> >> Sometimes it is necessary to split allocation and initialization into >> two steps. One such situation is when reusing existing allocations >> obtained via `Box::drop_contents`. See [1] for an example. >> In order to support this use case add `re_[pin_]init` functions to the >> pin-init API. These functions operate on already allocated smart >> pointers that contain `MaybeUninit`. >> >> Signed-off-by: Benno Lossin >> Link: https://lore.kernel.org/rust-for-linux/f026532f-8594-4f18-9aa5-57a= d3f5bc592@proton.me/ [1] >=20 > I'm not a big fan of the name. Perhaps we can use a name similar to > `Box::write`? Sure, what would be your suggestion? I can only think of `write_pinned`, but no idea what to do for `impl Init`... --=20 Cheers, Benno