It seems inefficient to pass around a &'a CriticalSection, since reference to zero-sized types are not themselves zero-sized in rust. In a lot of cases, this would be compiled out, but it is not guaranteed.
It would be better if CriticalSection was defined like this:
It seems inefficient to pass around a
&'a CriticalSection
, since reference to zero-sized types are not themselves zero-sized in rust. In a lot of cases, this would be compiled out, but it is not guaranteed.It would be better if
CriticalSection
was defined like this:Instead of passing
&'a CriticalSection
you would then pass aCriticalSection<'a>
around. This would have the same purpose