Getting The Size of a C++ Function

后端 未结 16 2146
醉酒成梦
醉酒成梦 2020-12-06 09:37

I was reading this question because I\'m trying to find the size of a function in a C++ program, It is hinted at that there may be a way that is platform specific. My target

16条回答
  •  萌比男神i
    2020-12-06 10:02

    It's an old question but still...

    For Windows x64, functions all have a function table, which contains the offset and the size of the function. https://docs.microsoft.com/en-us/windows/win32/debug/pe-format . This function table is used for unwinding when an exception is thrown.

    That said, this doesn't contain information like inlining, and all the other issues that people already noted...

提交回复
热议问题