Avatar
omochimetaru 8/8/2019 9:53 AM
https://github.com/apple/swift/blob/b70cd7031fe7a2c400976007abbfff1597189174/stdlib/public/runtime/ImageInspectionMachO.cpp#L141-L145 void swift::initializeProtocolConformanceLookup() { REGISTER_FUNC( addImageCallback<TextSegment, ProtocolConformancesSection, addImageProtocolConformanceBlockCallback>); }
The Swift Programming Language. Contribute to apple/swift development by creating an account on GitHub.
9:54 AM
#define REGISTER_FUNC(...) _dyld_register_func_for_add_image(__VA_ARGS__)
9:54 AM
When you call _dyld_register_func_for_add_image, the dynamic linker runtime calls the specified callback (func) once for each of the images that is currently loaded into the program. When a new image is added to the program, your callback is called again with the mach_header for the new image, and the virtual memory slide amount of the new image.