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
I realize that given the nsTArray mentions in the documentation this is probably out of scope, so feel free to just close this, but here I go anyway:
The conversion between Vec and ThinVec could be made cheaper by
a) calculating the layout in a way that the header is a multiple of size_of::<T> (at least for smallish T), this way turning ThinVec -> Vec would only require a memmove, not a layout change
b) turning the header into a trailer which could make the Vec -> ThinVec conversion free as long as there's enough spare capacity.
That way code could mostly deal in Vec and benefit from its api (e.g. Splice) and only turn things into a thinvec when putting it into a size-sensitive struct.
The text was updated successfully, but these errors were encountered:
I realize that given the
nsTArray
mentions in the documentation this is probably out of scope, so feel free to just close this, but here I go anyway:The conversion between Vec and ThinVec could be made cheaper by
a) calculating the layout in a way that the header is a multiple of
size_of::<T>
(at least for smallish T), this way turning ThinVec -> Vec would only require a memmove, not a layout changeb) turning the header into a trailer which could make the Vec -> ThinVec conversion free as long as there's enough spare capacity.
That way code could mostly deal in
Vec
and benefit from its api (e.g. Splice) and only turn things into a thinvec when putting it into a size-sensitive struct.The text was updated successfully, but these errors were encountered: