Size of a function

ark at alice.UUCP ark at alice.UUCP
Mon Jan 26 01:32:04 AEST 1987


In article <500 at gec-mi-at.co.uk>, jgh at gec-mi-at.co.uk (Jeremy Harris) writes:
> I had a need to pass a copy of a function to another task. Sizeof( function )
> would have been handy....

Maybe yes, maybe no.  You would also need:

	1. A way of actually getting at the function text.

	2. A guarantee that it was all contiguous.

	3. Some way of getting the copy to work.

The first is impossible on some architectures (such as the PDP-11).
The third assumes that either your object code is self-relocating
or you know how to relocate it somehow.

All these things may indeed be useful, but it is clear that they
would be a major addition to C.  sizeof(function) isn't nearly enough.



More information about the Comp.lang.c mailing list