What are some refactoring methods to reduce size of compiled code?

后端 未结 7 1453
夕颜
夕颜 2021-01-30 18:47

I have a legacy firmware application that requires new functionality. The size of the application was already near the limited flash capacity of the device and the few new funct

7条回答
  •  日久生厌
    2021-01-30 19:32

    Compiler optimisation that triggers bug ? That's strange. Get a map of your program, and see if you should target data or code. Look for duplicated code. Look for code with similar goal. One example of it is the busybox code, which aims for small memory footprint.

    It is favoring size over readability, so it sometimes get quite ugly, with gotos and so on.

提交回复
热议问题