[{"id":29384,"web_url":"https://patchwork.libcamera.org/comment/29384/","msgid":"<rk4ahc2g7d7k34tfdejc5dmj2ssneh4jzwzqvhkymhfv6ykkhn@ya6fvqwnzisp>","date":"2024-05-02T10:08:00","subject":"Re: [PATCH v1 5/5] libcamera: shared_mem_object: Remove\n\tis_standard_layout restriction","submitter":{"id":143,"url":"https://patchwork.libcamera.org/api/people/143/","name":"Jacopo Mondi","email":"jacopo.mondi@ideasonboard.com"},"content":"Hi Naush\n\nOn Thu, May 02, 2024 at 09:09:25AM GMT, Naushir Patuck wrote:\n> The shared_mem_object may be used to construct complex classes, so\n> remove the standard layout type restriction.\n>\n> Signed-off-by: Naushir Patuck <naush@raspberrypi.com>\n\nCan you already tell which non-standard-layout class you need to wrap\nin a SharedMemObject ?\n\nMy only concern is\n\"Standard layout types are useful for communicating with code written\nin other programming languages.\"\n\nbut as SharedMemObject is internal maybe I'm just over-concerned\n\n> ---\n>  include/libcamera/internal/shared_mem_object.h | 2 +-\n>  1 file changed, 1 insertion(+), 1 deletion(-)\n>\n> diff --git a/include/libcamera/internal/shared_mem_object.h b/include/libcamera/internal/shared_mem_object.h\n> index 9b1d939302a8..c9c0482062bd 100644\n> --- a/include/libcamera/internal/shared_mem_object.h\n> +++ b/include/libcamera/internal/shared_mem_object.h\n> @@ -56,7 +56,7 @@ private:\n>  \tSpan<uint8_t> mem_;\n>  };\n>\n> -template<class T, typename = std::enable_if_t<std::is_standard_layout<T>::value>>\n> +template<class T>\n>  class SharedMemObject : public SharedMem\n>  {\n>  public:\n> --\n> 2.34.1\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 26291BDE6B\n\tfor <parsemail@patchwork.libcamera.org>;\n\tThu,  2 May 2024 10:08:07 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 3E58063418;\n\tThu,  2 May 2024 12:08:06 +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 2A5E86340B\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu,  2 May 2024 12:08:04 +0200 (CEST)","from ideasonboard.com (93-61-96-190.ip145.fastwebnet.it\n\t[93.61.96.190])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 8B5023A3;\n\tThu,  2 May 2024 12:07:06 +0200 (CEST)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"Z3YE6AiC\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1714644426;\n\tbh=U005+sJW2oiQDUFT0EceePrJ0VGW4s4EfZEPgFT5Qtc=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=Z3YE6AiCtVrdiC6SwMCSoi3UQh6Q1wWyFH6FYv4n3ovxq1S7IpNwQ3US16fS9Bgb8\n\tJ5go/wQW3w/D29tgwbT1KXWaZOK896K8M9S/phxzWi4Bsa7/e5TCyDSWWhvrskBlZN\n\tUgTpfPsNQXFO8ghZYJowAE1+ubs1wzTy+17wW2SU=","Date":"Thu, 2 May 2024 12:08:00 +0200","From":"Jacopo Mondi <jacopo.mondi@ideasonboard.com>","To":"Naushir Patuck <naush@raspberrypi.com>","Cc":"libcamera-devel@lists.libcamera.org","Subject":"Re: [PATCH v1 5/5] libcamera: shared_mem_object: Remove\n\tis_standard_layout restriction","Message-ID":"<rk4ahc2g7d7k34tfdejc5dmj2ssneh4jzwzqvhkymhfv6ykkhn@ya6fvqwnzisp>","References":"<20240502080925.31730-1-naush@raspberrypi.com>\n\t<20240502080925.31730-6-naush@raspberrypi.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","In-Reply-To":"<20240502080925.31730-6-naush@raspberrypi.com>","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>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}},{"id":29386,"web_url":"https://patchwork.libcamera.org/comment/29386/","msgid":"<CAEmqJPog8LC+c6ob-39MNQ-0qWfPzasnSSCDnRcVUPn4zBwQhg@mail.gmail.com>","date":"2024-05-02T10:43:56","subject":"Re: [PATCH v1 5/5] libcamera: shared_mem_object: Remove\n\tis_standard_layout restriction","submitter":{"id":34,"url":"https://patchwork.libcamera.org/api/people/34/","name":"Naushir Patuck","email":"naush@raspberrypi.com"},"content":"Hi Jacopo,\n\nOn Thu, 2 May 2024 at 11:08, Jacopo Mondi <jacopo.mondi@ideasonboard.com> wrote:\n>\n> Hi Naush\n>\n> On Thu, May 02, 2024 at 09:09:25AM GMT, Naushir Patuck wrote:\n> > The shared_mem_object may be used to construct complex classes, so\n> > remove the standard layout type restriction.\n> >\n> > Signed-off-by: Naushir Patuck <naush@raspberrypi.com>\n>\n> Can you already tell which non-standard-layout class you need to wrap\n> in a SharedMemObject ?\n>\n> My only concern is\n> \"Standard layout types are useful for communicating with code written\n> in other programming languages.\"\n>\n> but as SharedMemObject is internal maybe I'm just over-concerned\n\nI am using the SharedMemObject to wrap the BackEnd and FrontEnd class\nobjects (from libpisp) in the Pi 5 pipeline handler and IPA.\n\nMy original implementation did not include this constraint, I think it\nwould be quite limiting if we could not use it for C++ objects in our\ncase :)\n\nRegards,\nNaush\n\n>\n>\n> > ---\n> >  include/libcamera/internal/shared_mem_object.h | 2 +-\n> >  1 file changed, 1 insertion(+), 1 deletion(-)\n> >\n> > diff --git a/include/libcamera/internal/shared_mem_object.h b/include/libcamera/internal/shared_mem_object.h\n> > index 9b1d939302a8..c9c0482062bd 100644\n> > --- a/include/libcamera/internal/shared_mem_object.h\n> > +++ b/include/libcamera/internal/shared_mem_object.h\n> > @@ -56,7 +56,7 @@ private:\n> >       Span<uint8_t> mem_;\n> >  };\n> >\n> > -template<class T, typename = std::enable_if_t<std::is_standard_layout<T>::value>>\n> > +template<class T>\n> >  class SharedMemObject : public SharedMem\n> >  {\n> >  public:\n> > --\n> > 2.34.1\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 86771BDE6B\n\tfor <parsemail@patchwork.libcamera.org>;\n\tThu,  2 May 2024 10:44:27 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 3BB0263416;\n\tThu,  2 May 2024 12:44:26 +0200 (CEST)","from mail-yw1-x1131.google.com (mail-yw1-x1131.google.com\n\t[IPv6:2607:f8b0:4864:20::1131])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id A7C3A6340B\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu,  2 May 2024 12:44:23 +0200 (CEST)","by mail-yw1-x1131.google.com with SMTP id\n\t00721157ae682-6150670d372so63897227b3.1\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu, 02 May 2024 03:44:23 -0700 (PDT)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (2048-bit key;\n\tunprotected) header.d=raspberrypi.com header.i=@raspberrypi.com\n\theader.b=\"hpwBlWyv\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=raspberrypi.com; s=google; t=1714646662; x=1715251462;\n\tdarn=lists.libcamera.org; \n\th=cc:to:subject:message-id:date:from:in-reply-to:references\n\t:mime-version:from:to:cc:subject:date:message-id:reply-to;\n\tbh=iKpWJ3xwjSTlQXijGpXcrKj1OSglcbXjS5Ms5BEkCBg=;\n\tb=hpwBlWyvSfa+TUt07RQDWjqTz1aPYv1BBuO6CMzhUiFQQdN3KTRcTRZfCNgoB8mAwc\n\tfbOQtpNZz6y6T3NZ/C3JZqFQAXNQy4K9FWrlehluQas+hupd0wD1sJRPxq2FfnW6n6Nv\n\t7ZVrh3+Np/tofNNK76O0Huamz/Kts3Sc5BKFkUVWaNL9PDS0VxEwZ2dYu0jvy9q+BJDU\n\tZJQfVcCqm5A2RleSyPBkuQKTEfLuM7SFDO+Nmiuqd3+ijpuF68j8ndZ9sxuRWAhzBxy0\n\t4E7aGlxY8B9Qw84RYG88zcDfwl1SLtBVcKrFi3JX6TvMTTlA/HS8DN1yQwz4ZUDKAUQI\n\t/+kg==","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20230601; t=1714646662; x=1715251462;\n\th=cc:to:subject:message-id:date:from:in-reply-to:references\n\t:mime-version:x-gm-message-state:from:to:cc:subject:date:message-id\n\t:reply-to;\n\tbh=iKpWJ3xwjSTlQXijGpXcrKj1OSglcbXjS5Ms5BEkCBg=;\n\tb=TSH5D4BWIuVwKZQR4NWlEhueB+K/cHl7GnXeMS0FvDKjCMKU+eKxuXcAFp/vaEQFWK\n\te2wvvtDtD3/DpiUpP9imxgJvn9+IKXQQLuNUOCa30V9NvzU6TpplAQmsZ3nPfZ3AnqX4\n\tNo7JpET+SrDqh8YBkOW/CsWaBc87NDX7tGXV6CQsPNePaHUJUFM92uuXMbZzf4mezJcF\n\tgMz0UFX8yaWjJOIOPQieh0C97aFoGyPAysLxz1UXgJaB8/prgiwt4SKx4mkL+HGZlhux\n\toOwg0wgf+bL7jqUx9Knd67hSuhPECthXxFA9xh2lRtIK9gnMSENWPhjN4PKMegPKcXZb\n\t94TQ==","X-Gm-Message-State":"AOJu0Yw3wDOdWUK7U5MDp2LbXgRUdik6xvOGx+E3u3QV4djh4x+Lhl3V\n\tO6oWpP7tTdU9eTBdVfseqihoSfZlhgqckbmSR8KO7ZPLPf1GmZH75evnsNNPbAe5tj8EODKAqA7\n\tyeMopBAgaEe5Z1FIj+8Xb20aLz9iNvlGrDjzAOnqNVLWI0qvWS2A=","X-Google-Smtp-Source":"AGHT+IHZOrzuZwUpS5y5AiW8NDPWCkkCVaMZfAafUyThxV+jWDRP19UOolvBSJ240ZKPXH3/6qbTHDJ3+nnTKIJAHu8=","X-Received":"by 2002:a05:690c:ecf:b0:61b:bd65:1538 with SMTP id\n\tcs15-20020a05690c0ecf00b0061bbd651538mr5411617ywb.3.1714646662276;\n\tThu, 02 May 2024 03:44:22 -0700 (PDT)","MIME-Version":"1.0","References":"<20240502080925.31730-1-naush@raspberrypi.com>\n\t<20240502080925.31730-6-naush@raspberrypi.com>\n\t<rk4ahc2g7d7k34tfdejc5dmj2ssneh4jzwzqvhkymhfv6ykkhn@ya6fvqwnzisp>","In-Reply-To":"<rk4ahc2g7d7k34tfdejc5dmj2ssneh4jzwzqvhkymhfv6ykkhn@ya6fvqwnzisp>","From":"Naushir Patuck <naush@raspberrypi.com>","Date":"Thu, 2 May 2024 11:43:56 +0100","Message-ID":"<CAEmqJPog8LC+c6ob-39MNQ-0qWfPzasnSSCDnRcVUPn4zBwQhg@mail.gmail.com>","Subject":"Re: [PATCH v1 5/5] libcamera: shared_mem_object: Remove\n\tis_standard_layout restriction","To":"Jacopo Mondi <jacopo.mondi@ideasonboard.com>","Cc":"libcamera-devel@lists.libcamera.org","Content-Type":"text/plain; charset=\"UTF-8\"","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>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}}]