Avoid standing the Objective-C runtime lock by calling objc_copyRealizedClassList_nolock instead of objc_copyRealizedClassList. We already guarantee that no other threads can run while we're running this utility expression, similar to when we parse the data ourself from the gdb_objc_realized_classes struct.
Details
Details
Diff Detail
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
Comment Actions
That seems fine to me. We already only allow one thread to run when we make this call, and copyRealizedClassList is read only, so at worst this will crash if the list is getting edited, but it won't do any harm and we'll just try again later. That's a much better failure mode than potentially stranding the ObjC runtime lock.