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
Currently the LayoutPartialTree trait uses &mut self references when it needs write access to the tree (for writing cache entries and final layout values. This makes sense, however it a couple of downsides:
It makes it much harder for Taffy to use borrowed references to styles. We can only borrow between writes, and any time a write occurs we have to drop the reference and then reborrow even though in practice the style is never mutated by the cache write.
This API may not work for parallel layout if we ever implement multithreading.
We should investigate switching to using &self for all trait methods (which would imply the use of interior mutability on the implementors side). This implies a runtime cost but this may well end up not being significant (to be measured).
The text was updated successfully, but these errors were encountered:
Currently the
LayoutPartialTree
trait uses&mut self
references when it needs write access to the tree (for writing cache entries and final layout values. This makes sense, however it a couple of downsides:We should investigate switching to using
&self
for all trait methods (which would imply the use of interior mutability on the implementors side). This implies a runtime cost but this may well end up not being significant (to be measured).The text was updated successfully, but these errors were encountered: