[libcamera-devel] [PATCH 5/5] libcamera: MappedBuffer: Delete copy and assignment

Kieran Bingham kieran.bingham at ideasonboard.com
Fri Oct 23 10:28:26 CEST 2020


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 at ideasonboard.com>
> 
> Reviewed-by: Laurent Pinchart <laurent.pinchart at 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
> 

-- 
Regards
--
Kieran


More information about the libcamera-devel mailing list