[{"id":12767,"web_url":"https://patchwork.libcamera.org/comment/12767/","msgid":"<20200925140733.GF3933@pendragon.ideasonboard.com>","date":"2020-09-25T14:07:33","subject":"Re: [libcamera-devel] [PATCH] FrameBufferAllocator: fix\n\tnon-copyability","submitter":{"id":2,"url":"https://patchwork.libcamera.org/api/people/2/","name":"Laurent Pinchart","email":"laurent.pinchart@ideasonboard.com"},"content":"Hi Tomi,\n\nThank you for the patch.\n\nOn Fri, Sep 25, 2020 at 05:05:25PM +0300, Tomi Valkeinen wrote:\n> FrameBufferAllocator is supposed to delete copy constructor and\n> copy-assignment operator. It doesn't do that as it uses Camera as a\n> parameter instead of FrameBufferAllocator.\n\nOops... Good catch.\n\nIt's a shame we can't have unit tests whose compilation failure would\nindicate success, to catch issues like these.\n\n> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@iki.fi>\n\nReviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n\n> ---\n>  include/libcamera/framebuffer_allocator.h | 4 ++--\n>  1 file changed, 2 insertions(+), 2 deletions(-)\n> \n> diff --git a/include/libcamera/framebuffer_allocator.h b/include/libcamera/framebuffer_allocator.h\n> index 78f1353..a96aaea 100644\n> --- a/include/libcamera/framebuffer_allocator.h\n> +++ b/include/libcamera/framebuffer_allocator.h\n> @@ -21,8 +21,8 @@ class FrameBufferAllocator\n>  {\n>  public:\n>  \tFrameBufferAllocator(std::shared_ptr<Camera> camera);\n> -\tFrameBufferAllocator(const Camera &) = delete;\n> -\tFrameBufferAllocator &operator=(const Camera &) = delete;\n> +\tFrameBufferAllocator(const FrameBufferAllocator &) = delete;\n> +\tFrameBufferAllocator &operator=(const FrameBufferAllocator &) = delete;\n>  \n>  \t~FrameBufferAllocator();\n>","headers":{"Return-Path":"<libcamera-devel-bounces@lists.libcamera.org>","X-Original-To":"parsemail@patchwork.libcamera.org","Delivered-To":"parsemail@patchwork.libcamera.org","Received":["from lancelot.ideasonboard.com (lancelot.ideasonboard.com\n\t[92.243.16.209])\n\tby patchwork.libcamera.org (Postfix) with ESMTPS id 5A2D2C3B5B\n\tfor <parsemail@patchwork.libcamera.org>;\n\tFri, 25 Sep 2020 14:08:11 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 1A85A63021;\n\tFri, 25 Sep 2020 16:08:11 +0200 (CEST)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 6137F62FD8\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 25 Sep 2020 16:08:10 +0200 (CEST)","from pendragon.ideasonboard.com (62-78-145-57.bb.dnainternet.fi\n\t[62.78.145.57])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id CC8D42D7;\n\tFri, 25 Sep 2020 16:08:06 +0200 (CEST)"],"Authentication-Results":"lancelot.ideasonboard.com;\n\tdkim=fail reason=\"signature verification failed\" (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"EdLkEA4g\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1601042887;\n\tbh=LNvY4zzPhW9UaTOawRczqubmJTdUsFJRFMQrBP7YmYM=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=EdLkEA4gn8F2tF+IxHHXzwghmR5ZWk3lM5B/PUtm/C9DMG4QK96g+Zb+hKcV6ILHV\n\tnHkPR5ihn0GMqZPgDQcgvDblWDguLaD0mGKpY9HMI7u7P2G8gxMPlctSo7BtUSi01b\n\trGf6SzTkdhiINCg8kCSFHfLqGdTTxm5weNB29SNA=","Date":"Fri, 25 Sep 2020 17:07:33 +0300","From":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","To":"Tomi Valkeinen <tomi.valkeinen@iki.fi>","Message-ID":"<20200925140733.GF3933@pendragon.ideasonboard.com>","References":"<20200925140525.91943-1-tomi.valkeinen@iki.fi>","MIME-Version":"1.0","Content-Disposition":"inline","In-Reply-To":"<20200925140525.91943-1-tomi.valkeinen@iki.fi>","Subject":"Re: [libcamera-devel] [PATCH] FrameBufferAllocator: fix\n\tnon-copyability","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.29","Precedence":"list","List-Id":"<libcamera-devel.lists.libcamera.org>","List-Unsubscribe":"<https://lists.libcamera.org/options/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=unsubscribe>","List-Archive":"<https://lists.libcamera.org/pipermail/libcamera-devel/>","List-Post":"<mailto:libcamera-devel@lists.libcamera.org>","List-Help":"<mailto:libcamera-devel-request@lists.libcamera.org?subject=help>","List-Subscribe":"<https://lists.libcamera.org/listinfo/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=subscribe>","Cc":"libcamera-devel@lists.libcamera.org","Content-Type":"text/plain; charset=\"us-ascii\"","Content-Transfer-Encoding":"7bit","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}},{"id":12769,"web_url":"https://patchwork.libcamera.org/comment/12769/","msgid":"<5030b2e9-7302-8cf4-0cb3-e3310f444329@ideasonboard.com>","date":"2020-09-25T14:15:19","subject":"Re: [libcamera-devel] [PATCH] FrameBufferAllocator: fix\n\tnon-copyability","submitter":{"id":4,"url":"https://patchwork.libcamera.org/api/people/4/","name":"Kieran Bingham","email":"kieran.bingham@ideasonboard.com"},"content":"Hi Tomi, Laurent,\n\nOn 25/09/2020 15:07, Laurent Pinchart wrote:\n> Hi Tomi,\n> \n> Thank you for the patch.\n> \n> On Fri, Sep 25, 2020 at 05:05:25PM +0300, Tomi Valkeinen wrote:\n>> FrameBufferAllocator is supposed to delete copy constructor and\n>> copy-assignment operator. It doesn't do that as it uses Camera as a\n>> parameter instead of FrameBufferAllocator.\n> \n> Oops... Good catch.\n> \n> It's a shame we can't have unit tests whose compilation failure would\n> indicate success, to catch issues like these.\n\nShould we perhaps make use of a macro to ensure this doesn't happen?\nsomething akin to the Chromium DISALLOW_COPY_AND_ASSIGN type macros?\n\n(Though, deleting them, rather than making them private).\n\n\n>> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@iki.fi>\n> \n> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n\nBut for this,\n\nReviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\n\n> \n>> ---\n>>  include/libcamera/framebuffer_allocator.h | 4 ++--\n>>  1 file changed, 2 insertions(+), 2 deletions(-)\n>>\n>> diff --git a/include/libcamera/framebuffer_allocator.h b/include/libcamera/framebuffer_allocator.h\n>> index 78f1353..a96aaea 100644\n>> --- a/include/libcamera/framebuffer_allocator.h\n>> +++ b/include/libcamera/framebuffer_allocator.h\n>> @@ -21,8 +21,8 @@ class FrameBufferAllocator\n>>  {\n>>  public:\n>>  \tFrameBufferAllocator(std::shared_ptr<Camera> camera);\n>> -\tFrameBufferAllocator(const Camera &) = delete;\n>> -\tFrameBufferAllocator &operator=(const Camera &) = delete;\n>> +\tFrameBufferAllocator(const FrameBufferAllocator &) = delete;\n>> +\tFrameBufferAllocator &operator=(const FrameBufferAllocator &) = delete;\n\n\n\n\n>>  \n>>  \t~FrameBufferAllocator();\n>>  \n>","headers":{"Return-Path":"<libcamera-devel-bounces@lists.libcamera.org>","X-Original-To":"parsemail@patchwork.libcamera.org","Delivered-To":"parsemail@patchwork.libcamera.org","Received":["from lancelot.ideasonboard.com (lancelot.ideasonboard.com\n\t[92.243.16.209])\n\tby patchwork.libcamera.org (Postfix) with ESMTPS id EBB5BC3B5C\n\tfor <parsemail@patchwork.libcamera.org>;\n\tFri, 25 Sep 2020 14:15:33 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 810E562FE6;\n\tFri, 25 Sep 2020 16:15:33 +0200 (CEST)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 612F562FD8\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 25 Sep 2020 16:15:31 +0200 (CEST)","from [192.168.0.20]\n\t(cpc89244-aztw30-2-0-cust3082.18-1.cable.virginm.net [86.31.172.11])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 068B72D7;\n\tFri, 25 Sep 2020 16:15:22 +0200 (CEST)"],"Authentication-Results":"lancelot.ideasonboard.com;\n\tdkim=fail reason=\"signature verification failed\" (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"auyBw3q8\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1601043324;\n\tbh=HHfmjt1qbmcl7/IsiPot+5kq1T90g0iHhb40NtFfO/0=;\n\th=Reply-To:Subject:To:Cc:References:From:Date:In-Reply-To:From;\n\tb=auyBw3q8Kw2vnvVV4v+p4ob3xr7UqiD509LlaZBRSK08/lNY3L52/lE7FgvDetMPE\n\tVC9jjSSWsg+sGRpdZ5hZobM2BqblT5uvPtKb4uIZ07fRCmSeL10wk4IBoFqr9Sd84J\n\t2cYBSyyUideZRzUMVIkMU5pps+EvPeAMhKBun7eI=","To":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>,\n\tTomi Valkeinen <tomi.valkeinen@iki.fi>","References":"<20200925140525.91943-1-tomi.valkeinen@iki.fi>\n\t<20200925140733.GF3933@pendragon.ideasonboard.com>","From":"Kieran Bingham <kieran.bingham@ideasonboard.com>","Autocrypt":"addr=kieran.bingham@ideasonboard.com; keydata=\n\tmQINBFYE/WYBEACs1PwjMD9rgCu1hlIiUA1AXR4rv2v+BCLUq//vrX5S5bjzxKAryRf0uHat\n\tV/zwz6hiDrZuHUACDB7X8OaQcwhLaVlq6byfoBr25+hb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/kE04\n\t/UqCMK/KnX8pwXEMCjz0h6qWNpGwJ0/tYIgQJZh6bqkvBrDogAvuhf60Sogw+mH8b+PBlx1L\n\toeTK396wc+4c3BfiC6pNtUS5GpsPMMjYMk7kVvEAEQEAAYkCPAQYAQoAJgIbDBYhBJAt15g/\n\tvSj943LUeqEeRnIQpGH9BQJdizzIBQkLSKZiAAoJEKEeRnIQpGH9eYgQAJpjaWNgqNOnMTmD\n\tMJggbwjIotypzIXfhHNCeTkG7+qCDlSaBPclcPGYrTwCt0YWPU2TgGgJrVhYT20ierN8LUvj\n\t6qOPTd+Uk7NFzL65qkh80ZKNBFddx1AabQpSVQKbdcLb8OFs85kuSvFdgqZwgxA1vl4TFhNz\n\tPZ79NAmXLackAx3sOVFhk4WQaKRshCB7cSl+RIng5S/ThOBlwNlcKG7j7W2MC06BlTbdEkUp\n\tECzuuRBv8wX4OQl+hbWbB/VKIx5HKlLu1eypen/5lNVzSqMMIYkkZcjV2SWQyUGxSwq0O/sx\n\tS0A8/atCHUXOboUsn54qdxrVDaK+6jIAuo8JiRWctP16KjzUM7MO0/+4zllM8EY57rXrj48j\n\tsbEYX0YQnzaj+jO6kJtoZsIaYR7rMMq9aUAjyiaEZpmP1qF/2sYenDx0Fg2BSlLvLvXM0vU8\n\tpQk3kgDu7kb/7PRYrZvBsr21EIQoIjXbZxDz/o7z95frkP71EaICttZ6k9q5oxxA5WC6sTXc\n\tMW8zs8avFNuA9VpXt0YupJd2ijtZy2mpZNG02fFVXhIn4G807G7+9mhuC4XG5rKlBBUXTvPU\n\tAfYnB4JBDLmLzBFavQfvonSfbitgXwCG3vS+9HEwAjU30Bar1PEOmIbiAoMzuKeRm2LVpmq4\n\tWZw01QYHU/GUV/zHJSFk","Organization":"Ideas on Board","Message-ID":"<5030b2e9-7302-8cf4-0cb3-e3310f444329@ideasonboard.com>","Date":"Fri, 25 Sep 2020 15:15:19 +0100","User-Agent":"Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101\n\tThunderbird/68.10.0","MIME-Version":"1.0","In-Reply-To":"<20200925140733.GF3933@pendragon.ideasonboard.com>","Content-Language":"en-GB","Subject":"Re: [libcamera-devel] [PATCH] FrameBufferAllocator: fix\n\tnon-copyability","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.29","Precedence":"list","List-Id":"<libcamera-devel.lists.libcamera.org>","List-Unsubscribe":"<https://lists.libcamera.org/options/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=unsubscribe>","List-Archive":"<https://lists.libcamera.org/pipermail/libcamera-devel/>","List-Post":"<mailto:libcamera-devel@lists.libcamera.org>","List-Help":"<mailto:libcamera-devel-request@lists.libcamera.org?subject=help>","List-Subscribe":"<https://lists.libcamera.org/listinfo/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=subscribe>","Reply-To":"kieran.bingham@ideasonboard.com","Cc":"libcamera-devel@lists.libcamera.org","Content-Type":"text/plain; charset=\"us-ascii\"","Content-Transfer-Encoding":"7bit","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}},{"id":12771,"web_url":"https://patchwork.libcamera.org/comment/12771/","msgid":"<c5bd7c57-d130-40df-5711-d1d390b16f06@iki.fi>","date":"2020-09-25T14:18:36","subject":"Re: [libcamera-devel] [PATCH] FrameBufferAllocator: fix\n\tnon-copyability","submitter":{"id":70,"url":"https://patchwork.libcamera.org/api/people/70/","name":"Tomi Valkeinen","email":"tomi.valkeinen@iki.fi"},"content":"On 25/09/2020 17:15, Kieran Bingham wrote:\n> Hi Tomi, Laurent,\n> \n> On 25/09/2020 15:07, Laurent Pinchart wrote:\n>> Hi Tomi,\n>>\n>> Thank you for the patch.\n>>\n>> On Fri, Sep 25, 2020 at 05:05:25PM +0300, Tomi Valkeinen wrote:\n>>> FrameBufferAllocator is supposed to delete copy constructor and\n>>> copy-assignment operator. It doesn't do that as it uses Camera as a\n>>> parameter instead of FrameBufferAllocator.\n>>\n>> Oops... Good catch.\n>>\n>> It's a shame we can't have unit tests whose compilation failure would\n>> indicate success, to catch issues like these.\n> \n> Should we perhaps make use of a macro to ensure this doesn't happen?\n> something akin to the Chromium DISALLOW_COPY_AND_ASSIGN type macros?\n> \n> (Though, deleting them, rather than making them private).\n\nProbably also a base class can do this:\n\nhttps://www.boost.org/doc/libs/1_65_0/libs/core/doc/html/core/noncopyable.html\n\n Tomi","headers":{"Return-Path":"<libcamera-devel-bounces@lists.libcamera.org>","X-Original-To":"parsemail@patchwork.libcamera.org","Delivered-To":"parsemail@patchwork.libcamera.org","Received":["from lancelot.ideasonboard.com (lancelot.ideasonboard.com\n\t[92.243.16.209])\n\tby patchwork.libcamera.org (Postfix) with ESMTPS id C1D01C3B5B\n\tfor <parsemail@patchwork.libcamera.org>;\n\tFri, 25 Sep 2020 14:19:40 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 5627B63034;\n\tFri, 25 Sep 2020 16:19:40 +0200 (CEST)","from mail-lj1-f195.google.com (mail-lj1-f195.google.com\n\t[209.85.208.195])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 0DF0F62FD8\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 25 Sep 2020 16:19:38 +0200 (CEST)","by mail-lj1-f195.google.com with SMTP id v23so2648657ljd.1\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 25 Sep 2020 07:19:38 -0700 (PDT)","from [192.168.1.111] (91-152-83-50.elisa-laajakaista.fi.\n\t[91.152.83.50]) by smtp.gmail.com with ESMTPSA id\n\tb21sm2338340lfb.52.2020.09.25.07.18.36\n\t(version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);\n\tFri, 25 Sep 2020 07:18:36 -0700 (PDT)"],"Authentication-Results":"lancelot.ideasonboard.com;\n\tdkim=fail reason=\"signature verification failed\" (2048-bit key;\n\tunprotected) header.d=gmail.com header.i=@gmail.com\n\theader.b=\"JQ61Ryxn\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;\n\th=sender:subject:to:cc:references:from:message-id:date:user-agent\n\t:mime-version:in-reply-to:content-language:content-transfer-encoding; \n\tbh=IcAoQiuwCfldt/+yJ6+C1OnrvZ9POHiYQznlJHlYYwY=;\n\tb=JQ61Ryxn6GNvrYtg7w5YREbloXZbIjJouVw/4QMbLX5zYOmcp7PNBUt1XxBZgZiRJh\n\toQq3BOhn10GeZN5y5KF9NrZPZQOVHv3WiM0aS5td+Ib8VAkNfmc+KIynjrByP3SaRW1v\n\tFbLAcmB6kfkl2Ndk01dfgN/KASwhPQhcALx+MYLHu2YIGGbH+g+yepZbZZ2RtQhAHW1y\n\tYxzuWBqYepKRWtZXBnAwxHbk9LW2nmaNoMd/DjRdLJd2oe4vn5MsgsoYfCFsySfdivLn\n\tkpinSmCKXfnpDkTaAaMhFpUJtmO5td76H8PxJeoH7UMMvjiZgtNVKLXpyhcmczFvjTIQ\n\tgaNg==","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20161025;\n\th=x-gm-message-state:sender:subject:to:cc:references:from:message-id\n\t:date:user-agent:mime-version:in-reply-to:content-language\n\t:content-transfer-encoding;\n\tbh=IcAoQiuwCfldt/+yJ6+C1OnrvZ9POHiYQznlJHlYYwY=;\n\tb=Q0XWz3RAPejDfYKMM/uBTJfMv0wXTfjgm3VDnlrjEUNFo8bznIWv0tscTo9tUd15TR\n\tIinG1XyYCCj5ouLzuxyXSzxAPAgj4unAlDAHWbB/Vm6cL/TkNXWWhhhNa4q5DWdjE8dO\n\t+B/aRQGxfRtH41GvIPLwsljtWZ+1FsjyMipE++n3ysQ9K/QHcDRxNvq/7ph4My1saVnO\n\tSkZ4Bu9lvY5NP7PxAWOpjiM4r/WgywlhUFHQ9CK0LUQQ95t+EU8bxkMJK+cr7Akr1Ycl\n\tj94efdJ23uNaj6HbYWNqmLlsgmU4yc+x0spZasHgFM8OyjNoc82wF8mtxR9uzXlWSLJV\n\tm28Q==","X-Gm-Message-State":"AOAM533jJCH+ooHw5DUZhgSGMCLljN02JTSebCoEerjHZWBUcNA2OUdg\n\tmGbIerWIq+63ehYEUqQKAmSenFulxFkZYw==","X-Google-Smtp-Source":"ABdhPJwXR3OJY/EjKuzxhnWpWo673TuWJkOjZdT9QOX2t3V/cKO7hBLp860FlBAXir9HKq1EqmYDUg==","X-Received":"by 2002:a05:651c:1053:: with SMTP id\n\tx19mr1613637ljm.32.1601043517350; \n\tFri, 25 Sep 2020 07:18:37 -0700 (PDT)","To":"kieran.bingham@ideasonboard.com,\n\tLaurent Pinchart <laurent.pinchart@ideasonboard.com>","References":"<20200925140525.91943-1-tomi.valkeinen@iki.fi>\n\t<20200925140733.GF3933@pendragon.ideasonboard.com>\n\t<5030b2e9-7302-8cf4-0cb3-e3310f444329@ideasonboard.com>","From":"Tomi Valkeinen <tomi.valkeinen@iki.fi>","Message-ID":"<c5bd7c57-d130-40df-5711-d1d390b16f06@iki.fi>","Date":"Fri, 25 Sep 2020 17:18:36 +0300","User-Agent":"Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101\n\tThunderbird/68.10.0","MIME-Version":"1.0","In-Reply-To":"<5030b2e9-7302-8cf4-0cb3-e3310f444329@ideasonboard.com>","Content-Language":"en-US","Subject":"Re: [libcamera-devel] [PATCH] FrameBufferAllocator: fix\n\tnon-copyability","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.29","Precedence":"list","List-Id":"<libcamera-devel.lists.libcamera.org>","List-Unsubscribe":"<https://lists.libcamera.org/options/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=unsubscribe>","List-Archive":"<https://lists.libcamera.org/pipermail/libcamera-devel/>","List-Post":"<mailto:libcamera-devel@lists.libcamera.org>","List-Help":"<mailto:libcamera-devel-request@lists.libcamera.org?subject=help>","List-Subscribe":"<https://lists.libcamera.org/listinfo/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=subscribe>","Cc":"libcamera-devel@lists.libcamera.org","Content-Type":"text/plain; charset=\"us-ascii\"","Content-Transfer-Encoding":"7bit","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}},{"id":12845,"web_url":"https://patchwork.libcamera.org/comment/12845/","msgid":"<20200929003001.GA28067@pendragon.ideasonboard.com>","date":"2020-09-29T00:30:01","subject":"Re: [libcamera-devel] [PATCH] FrameBufferAllocator: fix\n\tnon-copyability","submitter":{"id":2,"url":"https://patchwork.libcamera.org/api/people/2/","name":"Laurent Pinchart","email":"laurent.pinchart@ideasonboard.com"},"content":"Hi Tomi,\n\nOn Fri, Sep 25, 2020 at 05:18:36PM +0300, Tomi Valkeinen wrote:\n> On 25/09/2020 17:15, Kieran Bingham wrote:\n> > On 25/09/2020 15:07, Laurent Pinchart wrote:\n> >> On Fri, Sep 25, 2020 at 05:05:25PM +0300, Tomi Valkeinen wrote:\n> >>> FrameBufferAllocator is supposed to delete copy constructor and\n> >>> copy-assignment operator. It doesn't do that as it uses Camera as a\n> >>> parameter instead of FrameBufferAllocator.\n> >>\n> >> Oops... Good catch.\n> >>\n> >> It's a shame we can't have unit tests whose compilation failure would\n> >> indicate success, to catch issues like these.\n> > \n> > Should we perhaps make use of a macro to ensure this doesn't happen?\n> > something akin to the Chromium DISALLOW_COPY_AND_ASSIGN type macros?\n> > \n> > (Though, deleting them, rather than making them private).\n> \n> Probably also a base class can do this:\n> \n> https://www.boost.org/doc/libs/1_65_0/libs/core/doc/html/core/noncopyable.html\n\nThat's an interesting idea. I gave it a try and it works fine, but it\nsuffers from one issue. If class B derives from class A, and class A is\nmade non-copyable by deriving from boost::noncopyable, then B can't also\nderive from boost::noncopyable. That's fine from a behavioural point of\nview, as B won't be copyable if A isn't, but it fails to record the\nintent in B. If A is later refactored to become copyable while B should\nstay non-copyable, there's a risk B will be overlooked.\n\nWhat does everybody think, is that an acceptable risk, or would macros\nbe better ?","headers":{"Return-Path":"<libcamera-devel-bounces@lists.libcamera.org>","X-Original-To":"parsemail@patchwork.libcamera.org","Delivered-To":"parsemail@patchwork.libcamera.org","Received":["from lancelot.ideasonboard.com (lancelot.ideasonboard.com\n\t[92.243.16.209])\n\tby patchwork.libcamera.org (Postfix) with ESMTPS id 96264C3B5B\n\tfor <parsemail@patchwork.libcamera.org>;\n\tTue, 29 Sep 2020 00:30:38 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 051EC60D5B;\n\tTue, 29 Sep 2020 02:30:38 +0200 (CEST)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 907DB60367\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 29 Sep 2020 02:30:36 +0200 (CEST)","from pendragon.ideasonboard.com (62-78-145-57.bb.dnainternet.fi\n\t[62.78.145.57])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id F3AF8A58;\n\tTue, 29 Sep 2020 02:30:35 +0200 (CEST)"],"Authentication-Results":"lancelot.ideasonboard.com;\n\tdkim=fail reason=\"signature verification failed\" (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"ePZJxX2c\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1601339436;\n\tbh=gc0FXqNdD2LK+MDLBmuRlCpNq1swf23Qbsf3Wfs4Yjg=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=ePZJxX2cMZLc/3vMQnftmtwHNPVkUsl+H+dcG5g9+bAi5CoKJI049ZrT/d7jWumGS\n\tulMN603XvHuGOLpbyCHMPygwA60AjGzg/7fFK0ATlu3DbOkCB6j7f7l4b4DeB2EiEN\n\tfbNXlyjdxwr4xbmko+yI+QvNo7PCxToXZSv+zH1w=","Date":"Tue, 29 Sep 2020 03:30:01 +0300","From":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","To":"Tomi Valkeinen <tomi.valkeinen@iki.fi>","Message-ID":"<20200929003001.GA28067@pendragon.ideasonboard.com>","References":"<20200925140525.91943-1-tomi.valkeinen@iki.fi>\n\t<20200925140733.GF3933@pendragon.ideasonboard.com>\n\t<5030b2e9-7302-8cf4-0cb3-e3310f444329@ideasonboard.com>\n\t<c5bd7c57-d130-40df-5711-d1d390b16f06@iki.fi>","MIME-Version":"1.0","Content-Disposition":"inline","In-Reply-To":"<c5bd7c57-d130-40df-5711-d1d390b16f06@iki.fi>","Subject":"Re: [libcamera-devel] [PATCH] FrameBufferAllocator: fix\n\tnon-copyability","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.29","Precedence":"list","List-Id":"<libcamera-devel.lists.libcamera.org>","List-Unsubscribe":"<https://lists.libcamera.org/options/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=unsubscribe>","List-Archive":"<https://lists.libcamera.org/pipermail/libcamera-devel/>","List-Post":"<mailto:libcamera-devel@lists.libcamera.org>","List-Help":"<mailto:libcamera-devel-request@lists.libcamera.org?subject=help>","List-Subscribe":"<https://lists.libcamera.org/listinfo/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=subscribe>","Cc":"libcamera-devel@lists.libcamera.org","Content-Type":"text/plain; charset=\"us-ascii\"","Content-Transfer-Encoding":"7bit","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}},{"id":12868,"web_url":"https://patchwork.libcamera.org/comment/12868/","msgid":"<db00d373-18f7-51a6-587f-b7a8921de8f4@iki.fi>","date":"2020-09-29T06:43:35","subject":"Re: [libcamera-devel] [PATCH] FrameBufferAllocator: fix\n\tnon-copyability","submitter":{"id":70,"url":"https://patchwork.libcamera.org/api/people/70/","name":"Tomi Valkeinen","email":"tomi.valkeinen@iki.fi"},"content":"On 29/09/2020 03:30, Laurent Pinchart wrote:\n> Hi Tomi,\n> \n> On Fri, Sep 25, 2020 at 05:18:36PM +0300, Tomi Valkeinen wrote:\n>> On 25/09/2020 17:15, Kieran Bingham wrote:\n>>> On 25/09/2020 15:07, Laurent Pinchart wrote:\n>>>> On Fri, Sep 25, 2020 at 05:05:25PM +0300, Tomi Valkeinen wrote:\n>>>>> FrameBufferAllocator is supposed to delete copy constructor and\n>>>>> copy-assignment operator. It doesn't do that as it uses Camera as a\n>>>>> parameter instead of FrameBufferAllocator.\n>>>>\n>>>> Oops... Good catch.\n>>>>\n>>>> It's a shame we can't have unit tests whose compilation failure would\n>>>> indicate success, to catch issues like these.\n>>>\n>>> Should we perhaps make use of a macro to ensure this doesn't happen?\n>>> something akin to the Chromium DISALLOW_COPY_AND_ASSIGN type macros?\n>>>\n>>> (Though, deleting them, rather than making them private).\n>>\n>> Probably also a base class can do this:\n>>\n>> https://www.boost.org/doc/libs/1_65_0/libs/core/doc/html/core/noncopyable.html\n> \n> That's an interesting idea. I gave it a try and it works fine, but it\n> suffers from one issue. If class B derives from class A, and class A is\n> made non-copyable by deriving from boost::noncopyable, then B can't also\n> derive from boost::noncopyable. That's fine from a behavioural point of\n> view, as B won't be copyable if A isn't, but it fails to record the\n> intent in B. If A is later refactored to become copyable while B should\n> stay non-copyable, there's a risk B will be overlooked.\n> \n> What does everybody think, is that an acceptable risk, or would macros\n> be better ?\n\nMaybe this gets a bit hacky, but it does compile:\n\ntemplate<class T>\nclass noncopyable\n{\nprotected:\n\tconstexpr noncopyable() = default;\nprivate:\n\tnoncopyable(const noncopyable&) = delete;\n\tnoncopyable& operator=(const noncopyable&) = delete;\n};\n\nclass A : noncopyable<A>\n{\n\n};\n\nclass B : public A, noncopyable<B>\n{\n\n};\n\nIs that any better than a macro? I don't know... I'm sure it's heavier at compile time, but hopefully no overhead at runtime.\n\n Tomi","headers":{"Return-Path":"<libcamera-devel-bounces@lists.libcamera.org>","X-Original-To":"parsemail@patchwork.libcamera.org","Delivered-To":"parsemail@patchwork.libcamera.org","Received":["from lancelot.ideasonboard.com (lancelot.ideasonboard.com\n\t[92.243.16.209])\n\tby patchwork.libcamera.org (Postfix) with ESMTPS id 127E3C3B5B\n\tfor <parsemail@patchwork.libcamera.org>;\n\tTue, 29 Sep 2020 06:43:39 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 92209620BC;\n\tTue, 29 Sep 2020 08:43:38 +0200 (CEST)","from mail-lf1-x143.google.com (mail-lf1-x143.google.com\n\t[IPv6:2a00:1450:4864:20::143])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 24ADE6035E\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 29 Sep 2020 08:43:37 +0200 (CEST)","by mail-lf1-x143.google.com with SMTP id x69so4193923lff.3\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 28 Sep 2020 23:43:37 -0700 (PDT)","from [192.168.1.111] (91-152-83-50.elisa-laajakaista.fi.\n\t[91.152.83.50]) by smtp.gmail.com with ESMTPSA id\n\tt17sm267700ljo.23.2020.09.28.23.43.35\n\t(version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);\n\tMon, 28 Sep 2020 23:43:35 -0700 (PDT)"],"Authentication-Results":"lancelot.ideasonboard.com;\n\tdkim=fail reason=\"signature verification failed\" (2048-bit key;\n\tunprotected) header.d=gmail.com header.i=@gmail.com\n\theader.b=\"hwQbmZC0\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;\n\th=sender:subject:to:cc:references:from:message-id:date:user-agent\n\t:mime-version:in-reply-to:content-language:content-transfer-encoding; \n\tbh=uxK/Fbql12nojU1pDpstrF5DGPS/GLuRUyrbl9dSknM=;\n\tb=hwQbmZC0CigD9Fu59rBG7aYNaPKXRxJ/CpYy1oKJBFzVEVEunTl1QkWCStMDto0Cld\n\tdhfB6yEoDj0SkKKs3gHuwcrpcMiajaYyze1+wnLYfaSz4MKbxWckQL3K/Nfgvy4x3UFf\n\tAQ2jlmNmZAbCiPKq6egYVKez2x+2l7dwDyOPRV28brqr2/3g7AFPFNb3IBxpXAvF/g9q\n\td+IbjwzYkAP3pPpuiS5AwotFa8Kc3SpunebByAIkKU5hjcy0ST2omLxMwE+5ULQD5klp\n\tYGtL6nm0FcJvioEbDS2rGzoiWQA4hTFQ1HtcrhgzameQEEGMDZbVlDGA541yH+En6ZQO\n\tLDUg==","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20161025;\n\th=x-gm-message-state:sender:subject:to:cc:references:from:message-id\n\t:date:user-agent:mime-version:in-reply-to:content-language\n\t:content-transfer-encoding;\n\tbh=uxK/Fbql12nojU1pDpstrF5DGPS/GLuRUyrbl9dSknM=;\n\tb=VP/roEzt7p9MtbXk/fqgj/naLIlWGIrvHhvZAzTUYWDQ2YNlAaMkt/CB9rvducrqjM\n\tRBfKWjxPHrOtPluRpkpGGS7uug6VFlg5osdzCYDp0pAvnyk3MqTYzTvw/6Y58RHkY/Fg\n\txY+aA4USyj45uF0S7xLQVbLiC0V9u5sfbCU9S8RbmrxEdykwFcNo+i4p4o0VZVAuNJWw\n\tBLbSfVcl19I/HBF60crXWeFuUZbzOPJiWRW3hNtY4bQhGCAf1IKY89Fb2Qc5w2a5cWHY\n\tIC0bMgw+wFAUpjLngw6xIGGEODvu+XSN9LKlycYDM6ApDFh5J2i9yv5xzvRy8i5xm7Q/\n\tAE3g==","X-Gm-Message-State":"AOAM532++UODisMHbeyzWlk/ClGxKOB0q5hg0tcSocfhM5bJm/dMmFnJ\n\tqaSSC6gmO4Ez71MMdfxAtB1lcRAp0MpNZA==","X-Google-Smtp-Source":"ABdhPJyMbkrkbIsLdX6h5m5It5XBiQBkuNYnf+d4CIiF8BHnyaTM25saNR6rcBgubocM26fvhRhZUg==","X-Received":"by 2002:a05:6512:36cd:: with SMTP id\n\te13mr708853lfs.165.1601361816130; \n\tMon, 28 Sep 2020 23:43:36 -0700 (PDT)","To":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","References":"<20200925140525.91943-1-tomi.valkeinen@iki.fi>\n\t<20200925140733.GF3933@pendragon.ideasonboard.com>\n\t<5030b2e9-7302-8cf4-0cb3-e3310f444329@ideasonboard.com>\n\t<c5bd7c57-d130-40df-5711-d1d390b16f06@iki.fi>\n\t<20200929003001.GA28067@pendragon.ideasonboard.com>","From":"Tomi Valkeinen <tomi.valkeinen@iki.fi>","Message-ID":"<db00d373-18f7-51a6-587f-b7a8921de8f4@iki.fi>","Date":"Tue, 29 Sep 2020 09:43:35 +0300","User-Agent":"Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101\n\tThunderbird/68.10.0","MIME-Version":"1.0","In-Reply-To":"<20200929003001.GA28067@pendragon.ideasonboard.com>","Content-Language":"en-US","Subject":"Re: [libcamera-devel] [PATCH] FrameBufferAllocator: fix\n\tnon-copyability","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.29","Precedence":"list","List-Id":"<libcamera-devel.lists.libcamera.org>","List-Unsubscribe":"<https://lists.libcamera.org/options/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=unsubscribe>","List-Archive":"<https://lists.libcamera.org/pipermail/libcamera-devel/>","List-Post":"<mailto:libcamera-devel@lists.libcamera.org>","List-Help":"<mailto:libcamera-devel-request@lists.libcamera.org?subject=help>","List-Subscribe":"<https://lists.libcamera.org/listinfo/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=subscribe>","Cc":"libcamera-devel@lists.libcamera.org","Content-Type":"text/plain; charset=\"us-ascii\"","Content-Transfer-Encoding":"7bit","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}}]