[PATCH v1] treewide: move construct/assign `shared_ptr`s where possible

Barnabás Pőcze pobrn at protonmail.com
Fri Jun 14 23:29:42 CEST 2024


Oops, of course the title should have a capital "M".
Does `utils/checkstyle.py` not check that or am I just holding it wrong?


Regards,
Barnabás Pőcze


2024. június 14., péntek 23:22 keltezéssel, Barnabás Pőcze <pobrn at protonmail.com> írta:

> Copy construction/assignment is more expensive than move construction/assignment
> because it involves managing the reference counts. In fact, libstdc++ even
> checks a global variable to determine whether threads are used.
> 
> In contrast, move construction can be done without any conditionals
> or reference count changes. So prefer move construction and assignment
> where possible.
> 
> Signed-off-by: Barnabás Pőcze pobrn at protonmail.com
> 
> ---
> [...]


More information about the libcamera-devel mailing list