You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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:
structCriticalSection<'a>{_0:PhantomData<&'a()>,}
Instead of passing &'a CriticalSection you would then pass a CriticalSection<'a> around. This would have the same purpose
The text was updated successfully, but these errors were encountered:
20: Use CriticalSection<'cs> instead of &'cs CriticalSection. r=jonas-schievink a=m-ou-se
Fixes#7.
A `CriticalSection<'cs>` has a size of zero
unlike a `&'cs CriticalSection`, which has the size of a pointer.
Co-authored-by: Mara Bos <[email protected]>
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 purposeThe text was updated successfully, but these errors were encountered: