Commit ff7ba2a
authored
Reflection: correct conformance table iteration
Adjust the iteration of the conformance table to match the current data structure layout.
`MapData` is a view into the `ConformanceState`:
~~~
[+0x00] Cache [Type: swift::ConcurrentReadableHashMap<ConformaanceCacheEntry, swift::StaticMutex>]
[+0x28] SectionsToScan [Type: swift::ConcurrentReadableArray<ConformanceSection>]
[+0x50] scanSectionsBackwards [Type: bool]
~~~
`Cache` itself is a structure:
~~~
[+0x00] ReaderCount [Type: std::atomic<uint32_t>]
[+0x04] ElementCount [Type: std::atomic<uint32_t>]
[+0x08] Elements [Type: std::atomic<swift::ConcurrentReadableHashMap<ConformanceCacheEntry, swift::staticMutex>::ElementStorage *>]
~~~
The `ElementStorage` backing `Elements` actually looks like:
~~~
[+0x00] Capacity [Type: uint32_t]
[+0x08] Elem [Typwe: ConformanceCacheEntry]
~~~
The `Capacity` field will be pointer aligned (a previous change has changed this
to be explicitly pointer sized bit-sliced). However, we would previously fail
to accomodate the `Capacity` field, and read the contents shifted by the size of
`Capacity`. This repairs the iteration off the `ConformanceCache`.1 parent dde3291 commit ff7ba2a
1 file changed
+2
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1157 | 1157 | | |
1158 | 1158 | | |
1159 | 1159 | | |
1160 | | - | |
| 1160 | + | |
1161 | 1161 | | |
1162 | 1162 | | |
1163 | 1163 | | |
1164 | 1164 | | |
1165 | 1165 | | |
1166 | 1166 | | |
1167 | 1167 | | |
1168 | | - | |
| 1168 | + | |
1169 | 1169 | | |
1170 | 1170 | | |
1171 | 1171 | | |
| |||
0 commit comments