|
-
August 12th, 2002, 03:27 PM
#1
how to get the exact size of a function
I have a few functions and their function pointers. I have to display the memory size of those functions. The problem is that if I use sizeof operator on the function pointers they return a constant value. so how then can I get the exact size of a function.
-
August 12th, 2002, 03:45 PM
#2
Most compilers and linkers put funtions into the object file in the order in which they appear in the code. Therefore you can put a dummy function after the function the size of which you want to know, than simply substract the adresses.
Ce n'est que pour vous dire ce que je vous dis.
-
August 12th, 2002, 04:04 PM
#3
isnt there another proper way?
-
August 12th, 2002, 04:24 PM
#4
If there is, Jeffrey Richter doesn't know about it. My advise was from his book.
Ce n'est que pour vous dire ce que je vous dis.
-
August 12th, 2002, 10:21 PM
#5
Remember that function pointers are just that--pointers. Therefore, they are expected to have the same size as any other pointer in the program (4 or 8 bytes).
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|