Maximum executable file size on iPhone?

Is there a maximum size for executable files or executable files + common objects on the iPhone? I am developing an application that crashed at startup or at the beginning of execution with SIGSYS. Removing code from the program helped, although structuring the data so that the code simply does not execute does not.

This may be incorrect memory corruption, however, when I compiled with -Os rather than -O2 or -O3, the size of my executable is reduced from 5.15 to 3.60 MB, and the application works fine. Of course, I also have a bunch of libraries that I use.

I am wondering if there is a limit on the size of executable code on the iPhone? Or am I just β€œgetting lucky” and masking memory corruption when I use -O?

+4
source share
4 answers

If there is a maximum size, you cannot use it with the application file 5.15 or 3.60 MB. You have another error in your application.

You are lucky.

+2
source

You probably don't have enough memory. Do you get memory alerts?

0
source

The maximum executable file size for delivery through the application store, but the hardware does not impose any unusual restrictions.

Your problem is most likely in one of your libraries. Which, based on your description of the complexity of your application, is not a useful observation on my part.

Given a template with compiler options, I'm going to take a wild, wild hunch that you have a library that has a problem, and a harder compiler leads to code exception.

Under the title of a long shot, you can also take a look at resources such as images. I have seen a couple of cases over the past couple of years in which seemingly harmless resources cause fatal download errors.

0
source

I ran into the same problem. In some tens or hundreds of C ++ kloc, I had no problems. Now I essentially copied & pasted the class and renamed the two buttons, and I got an access violation on startup.

None of the new codes are ever executed, simply linked, because I take the address of the function. The newly linked compilation unit does not rely on one static character outside, which can cause background code to execute.

The debugger does not indicate a useful location. My executable is about 3.6 MB.

0
source

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


All Articles