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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id DC246C433F5 for ; Thu, 29 Sep 2022 11:17:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234315AbiI2LRR (ORCPT ); Thu, 29 Sep 2022 07:17:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43310 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234889AbiI2LRM (ORCPT ); Thu, 29 Sep 2022 07:17:12 -0400 Received: from mail-wr1-x42b.google.com (mail-wr1-x42b.google.com [IPv6:2a00:1450:4864:20::42b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0841513E7F6 for ; Thu, 29 Sep 2022 04:17:11 -0700 (PDT) Received: by mail-wr1-x42b.google.com with SMTP id bk15so1628518wrb.13 for ; Thu, 29 Sep 2022 04:17:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bgdev-pl.20210112.gappssmtp.com; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date; bh=5psvd8uIPHvr1x8pF6LzkcSxElTADKW25AlmbHcPXl4=; b=OgcatXoM0HAXeh8RTNP7y7zUfugJLPbduPfcsHx5U97CuzT5zOJsO5Uq7wxQOHHQ/g nH5UxL12C9FysYsqbTCEbkWC8FzNLNB8UHtXbl6cwqJhSLINYJniafkRUMpOBh3SuUsh o1a99H9thZuxSpyaAe5bpa2tFlnRggZF6AbYPt9YA1qu1a/6P/egkfn7WqiYxULmkl4j qIVGMQiD8FEY1JHuGBGYr8KangMzxD+5nzpVt0I7ar2o1yb0D19AyfWo80KSsXmYO1IQ sgQjCgXN29cqL1ux3zjeLN/VE9X6pDorbpu7w7TsdhfWcUJHGfq96Jgsaw1S2CTN+8Y0 IeOg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date; bh=5psvd8uIPHvr1x8pF6LzkcSxElTADKW25AlmbHcPXl4=; b=6hfV8xlg5FcMfmTopbEiK9h6y78guZE0DD1Yuagl+y//dP0NybICo8/ETPHIw9sLUS eDG4bbLO0Ce5BD1feNkkrTcxkV7k+5M1S/ytDDQ/8sroOhO6vb0WxGsfco3WaoiyMPhm 1BFDJJCZqKXInJxLx1LVl7IyWWeXdnKoVPuthRxJCX4KBB9klQGxKZszIb9QqzNXcuH8 2mmy8CPAR5i4Bx3Dx4U9spaLBpVF7BtQWDOBW7siJI4DT6e/p2B57DwqSJB+LRSUTHnc hOVhLPSTNilGz5C1w/h46qCpbTlKfvkQj5aYWKxoEzcSH6uhg9Y3Nf2A26gSzXrw7m6A hsxQ== X-Gm-Message-State: ACrzQf2EkH1/JUSDl8tt7QJdTRWTtpFc6S+J6xxDTaZxwUoys3gWM2sD +55LgDSBukRfSqWivrDXpjlPMQ7JXdol4vGratDU5A== X-Google-Smtp-Source: AMsMyM44ZeXVFc+1ElAJcbkA+CKeCCttXtBfG9xJLNVLmdK1d8JL0C22Xgn8C4pSifSWW7fFFi1ek8wAOS+s24YGk00= X-Received: by 2002:a05:6000:15ce:b0:226:f2ab:516d with SMTP id y14-20020a05600015ce00b00226f2ab516dmr1877904wry.264.1664450229571; Thu, 29 Sep 2022 04:17:09 -0700 (PDT) MIME-Version: 1.0 References: <20220928111043.bs2ihopdxduavcsq@vireshk-i7> <20220928151716.3hhbcrjwskvwvajh@vireshk-i7> <20220929065409.rqilrzxaczvvds4i@vireshk-i7> In-Reply-To: From: Bartosz Golaszewski Date: Thu, 29 Sep 2022 13:16:58 +0200 Message-ID: Subject: Re: [PATCH V6 3/8] libgpiod: Add rust wrapper crate To: Viresh Kumar , Miguel Ojeda Cc: Linus Walleij , Vincent Guittot , linux-gpio@vger.kernel.org, Kent Gibson , =?UTF-8?B?QWxleCBCZW5uw6ll?= , stratos-dev@op-lists.linaro.org, Gerard Ryan Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-gpio@vger.kernel.org On Thu, Sep 29, 2022 at 10:58 AM Viresh Kumar wrote: > > On Thu, 29 Sept 2022 at 13:07, Bartosz Golaszewski wrote: > > I'm not talking about locking, this should be left to the user of the module. > > Yeah, I get that. > > > Can we force-drop an object still referenced by other objects in Rust? > > No, AFAICT. > > We can call drop(x) on an object, but as long as an reference to > it is out there, we won't end up calling the actualy drop() routine > for the object. > > > This is what I had in mind - a small, dummy, cheap object inside the > > buffer that's created when reading into the buffer. Each even would > > reference it and then Rust would not allow us to drop it as long as > > there are references to it. Does it make sense? Is that possible? > > I don't think so. Miguel: Could you give us advice on how to proceed with this? Bart > > > Nah, just take the time off and rest. BTW, I'm starting at linaro next week. :) > > Excellent, welcome buddy :) > > -- > Viresh