Performance Considerations When Mixing C ++ and Objective-C in a Single File

I have high-performance C ++ that I need to associate with Objective-C, is there any performance degradation just to dump this code into a .mm file containing my Objective-C code, or leave this code separate .cpp and extern-all are all the functions that I need to call from a .mm file?

+3
source share
4 answers

There are several issues here.

(1) if your C ++ engine code works in isolation - if Objective-C acts as the interface that starts the base engine, then there is no penalty at all. C ++ bits in ObjC ++ compile in the same way as regular C ++.

(2) Objective-C , . Objective-C - objc_msgSend() ( ) - , , , , , . , ++ , , , ( ). Objective-C .

(3) , ...

+4

, , , , , , , . , , .

+1

, , ++, , .

, , ++ "extern C".

0

Objective-C , ++, , .

-1

Source: https://habr.com/ru/post/1744256/


All Articles