Message ID | 20201022135605.614240-6-kieran.bingham@ideasonboard.com |
---|---|
State | Superseded |
Delegated to: | Kieran Bingham |
Headers | show |
Series |
|
Related | show |
Hi Kieran, Thank you for the patch. On Thu, Oct 22, 2020 at 02:56:05PM +0100, Kieran Bingham wrote: > Prevent copying and assignment of MappedBuffer types, which could invoke unmapping > or mapped memory. Line wrap ? > Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> > --- > include/libcamera/internal/buffer.h | 4 ++++ > 1 file changed, 4 insertions(+) > > diff --git a/include/libcamera/internal/buffer.h b/include/libcamera/internal/buffer.h > index b7b0173f93f5..8c7126482b95 100644 > --- a/include/libcamera/internal/buffer.h > +++ b/include/libcamera/internal/buffer.h > @@ -10,6 +10,7 @@ > #include <sys/mman.h> > #include <vector> > > +#include <libcamera/class.h> > #include <libcamera/buffer.h> > #include <libcamera/span.h> > > @@ -34,6 +35,9 @@ protected: > > int error_; > std::vector<Plane> maps_; > + > +private: > + DELETE_COPY_AND_ASSIGN(MappedBuffer); > }; > > class MappedFrameBuffer : public MappedBuffer
On 23/10/2020 05:41, Laurent Pinchart wrote: > Hi Kieran, > > Thank you for the patch. > > On Thu, Oct 22, 2020 at 02:56:05PM +0100, Kieran Bingham wrote: >> Prevent copying and assignment of MappedBuffer types, which could invoke unmapping >> or mapped memory. > > Line wrap ? How has this happened on every patch. Normally my editor does this for me ! :-( > >> Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com> > > Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> > >> --- >> include/libcamera/internal/buffer.h | 4 ++++ >> 1 file changed, 4 insertions(+) >> >> diff --git a/include/libcamera/internal/buffer.h b/include/libcamera/internal/buffer.h >> index b7b0173f93f5..8c7126482b95 100644 >> --- a/include/libcamera/internal/buffer.h >> +++ b/include/libcamera/internal/buffer.h >> @@ -10,6 +10,7 @@ >> #include <sys/mman.h> >> #include <vector> >> >> +#include <libcamera/class.h> >> #include <libcamera/buffer.h> >> #include <libcamera/span.h> >> >> @@ -34,6 +35,9 @@ protected: >> >> int error_; >> std::vector<Plane> maps_; >> + >> +private: >> + DELETE_COPY_AND_ASSIGN(MappedBuffer); >> }; >> >> class MappedFrameBuffer : public MappedBuffer >
diff --git a/include/libcamera/internal/buffer.h b/include/libcamera/internal/buffer.h index b7b0173f93f5..8c7126482b95 100644 --- a/include/libcamera/internal/buffer.h +++ b/include/libcamera/internal/buffer.h @@ -10,6 +10,7 @@ #include <sys/mman.h> #include <vector> +#include <libcamera/class.h> #include <libcamera/buffer.h> #include <libcamera/span.h> @@ -34,6 +35,9 @@ protected: int error_; std::vector<Plane> maps_; + +private: + DELETE_COPY_AND_ASSIGN(MappedBuffer); }; class MappedFrameBuffer : public MappedBuffer
Prevent copying and assignment of MappedBuffer types, which could invoke unmapping or mapped memory. Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com> --- include/libcamera/internal/buffer.h | 4 ++++ 1 file changed, 4 insertions(+)