get size of function

maarten van damme maartenvd1994 at gmail.com
Tue Aug 30 16:39:05 PDT 2011


2011/8/30 Johannes Pfau <spam at example.com>

> You could use the same hacks as in C:
> Declare another function, make sure their located sequentially in
> memory and compare their function addresses to get the size of the first
> function (+ potential padding for alignment, but that shouldn't matter).
>
I think thats the way to go, a sequential function's adress minus the
functions address. how can I make sure they're sequentially alligned?


> I do not recommend to do this though, it's a baaaad hack, and I don't
> even remember how exactly it worked.
>
 But better a (dirty) way then no way at all.

I've also been playing with the idea of writing the function, and trying to
compile that one function in a text file and importing at compile time in my
main program. Then I can also count the bytes in the file.
sounds an awfull lot of work :p
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.puremagic.com/pipermail/digitalmars-d-learn/attachments/20110831/c9d64888/attachment.html>


More information about the Digitalmars-d-learn mailing list