Commit f14a4d1
committed
Use std::mutex instead of never-shared std::shared_mutex in ShadowNodeFamily
ShadowNodeFamily::mutex_ is declared std::shared_mutex but has not been
acquired in shared mode since February 2020. All three call sites take it
exclusively via unique_lock, and there is no shared_lock in the class.
Of the 17 classes in ReactCommon that declare a std::shared_mutex, this is
the only one that never takes a shared_lock.
Reduces sizeof(ShadowNodeFamily) from 384 to 272 bytes on arm64 (-112, -29%).
There is one family per host element, so this scales with tree size.
Changelog: [GENERAL] [CHANGED] - Replace never-shared std::shared_mutex with std::mutex in ShadowNodeFamily1 parent 4be68ef commit f14a4d1
1 file changed
Lines changed: 1 addition & 2 deletions
Lines changed: 1 addition & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
12 | | - | |
13 | 12 | | |
14 | 13 | | |
15 | 14 | | |
| |||
145 | 144 | | |
146 | 145 | | |
147 | 146 | | |
148 | | - | |
| 147 | + | |
149 | 148 | | |
150 | 149 | | |
151 | 150 | | |
| |||
0 commit comments