A
asit dhal
Can any one write a code to measure the size of a function in gcc or vc
++ ?
++ ?
asit said:Can any one write a code to measure the size of a function in gcc or vc
++ ?
Can any one write a code to measure the size of a function in gcc or vc
++ ?
asit dhal said:Can any one write a code to measure the size of a function in gcc or vc
++ ?
void fsize( void (*fptr)() )
{
unsigned char bigbuff[1024*32];
void (*tptr)() = ( void (*) ()) bigbuff;
int len;
for(len = 1024*32; len >= 0; len--)
{
printf("trying %d\n", len);
memcpy(bigbuff, fptr, len);
(*tptr)();
}
}
There's a sporting chance that the this will print out values
until it segfaults. The last value is the size of your function.
When the
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.