mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
Determining a descriptor's size requires reading its contents, but reading its contents from out of process requires knowing its size. Build up the size incrementally by walking over the TrailingObjects. Take advantage of the fact that each trailing object's presence/count depends only on data that comes before it. This allows us to read prefixes that we gradually expand until we've covered the whole thing. Add calls to TrailingObjects to allow iterating over the prefix sizes, and modify readContextDescriptor to use them. This replaces the old code which attempted to determine the descriptor size in an ad-hoc fashion that didn't always get it right. rdar://146006006
29 KiB
29 KiB