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 954DAC04A95 for ; Thu, 29 Sep 2022 08:58:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231340AbiI2I64 (ORCPT ); Thu, 29 Sep 2022 04:58:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54680 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230341AbiI2I6z (ORCPT ); Thu, 29 Sep 2022 04:58:55 -0400 Received: from mail-wr1-x431.google.com (mail-wr1-x431.google.com [IPv6:2a00:1450:4864:20::431]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AC5EA13EE83 for ; Thu, 29 Sep 2022 01:58:54 -0700 (PDT) Received: by mail-wr1-x431.google.com with SMTP id u10so978849wrq.2 for ; Thu, 29 Sep 2022 01:58:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date; bh=49LO9KOXlQ5z0qQQQqCdbVyJW40MVbqgcdfSfBxCrcU=; b=WQ98pAg82F+SInoUJ/hDO0m/aYXNZw9xrzR5AF4TozeS8JZXHI2GjvVUB1/58vWuuX HDhzy7cJt3APMRWYv3rEbsgb7tJ6wmzFTujnVIq+ie/hxmiZaBe3+5XehcOrZL5C+R73 8i4/pkyf514ycLY+F6zy+r8W2qdtaoxjm4mKwzoattrrbW4KYRx3LO7LkpyC3STbQ+H2 TY207Y2ZToClJLDYl4IR2L6eOLg1XFZ6h9XPF5m4Qc95eROrrUpTcz0vkhNph7LXOvc7 6ehdBffrDu2/xfgyEWcT3mU/0UJ6C8JUAqbYEguP2YkKn/Nrnz+oCEldicBjq1s6R5DV Zc4w== 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=49LO9KOXlQ5z0qQQQqCdbVyJW40MVbqgcdfSfBxCrcU=; b=MapkT1TbZy41ajggvaJ3tRXKutL3mGvrcQx/8iF3yRfLXKUeLIc+ZgqAtBalqStWzG dvaiypXg8rtUCq9MVx598iQDsU76KQO7sP5FnSoVdRVSUd7ABKyrrt0gWZd98/zIwJzb mQ+V3dst4GKk0mzs7t0vTWp42IQDObd7etAwm5j3B9mCCs6crJaDCYd2zzEC4Ujo3Shm Lea6ZJUwrSiHgjlAuIRoCuFbzONbfg5D0yOcL1UVYxx6O72It3d4Go0DGXWsyD4wjobd GOhuyqSiia0/LvxHtLGSbrKQdvAIiFgRj/fP7I5ggNhvEqPavMej0LuLB+FNpCsg1+AC CBlA== X-Gm-Message-State: ACrzQf0PUkMVrB049Q9UYldvXHOLDDJmrdQBN3yhqJjYUW/ijU6wo6pJ 57bjADkyQTAW5znMzEhz44Mhj9X6As/vvaHFDYnRxQ== X-Google-Smtp-Source: AMsMyM50+y9zXkdSHRTS8tmdOEpf/G1XGPb768k4wgaTb/tkRaFDHIbT6HMpB8gw6tYcMf0UmDvoS1gor4vIOqHilHk= X-Received: by 2002:a5d:5254:0:b0:22c:cae2:ddcb with SMTP id k20-20020a5d5254000000b0022ccae2ddcbmr1427079wrc.633.1664441932950; Thu, 29 Sep 2022 01:58:52 -0700 (PDT) MIME-Version: 1.0 References: <20220928111043.bs2ihopdxduavcsq@vireshk-i7> <20220928151716.3hhbcrjwskvwvajh@vireshk-i7> <20220929065409.rqilrzxaczvvds4i@vireshk-i7> In-Reply-To: From: Viresh Kumar Date: Thu, 29 Sep 2022 14:28:41 +0530 Message-ID: Subject: Re: [PATCH V6 3/8] libgpiod: Add rust wrapper crate To: Bartosz Golaszewski Cc: Linus Walleij , Vincent Guittot , linux-gpio@vger.kernel.org, Kent Gibson , Miguel Ojeda , =?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, 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. > Nah, just take the time off and rest. BTW, I'm starting at linaro next week. :) Excellent, welcome buddy :) -- Viresh