Date: Sun, 17 Aug 1997 19:58:26 +0300 (IDT) From: Eli Zaretskii To: *** Brett *** cc: Mike4148 , DJGPP Subject: Re: Function Sizes In-Reply-To: <199708170025.KAA06148@rabble.uow.edu.au> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Precedence: bulk On Sun, 17 Aug 1997, *** Brett *** wrote: > > Is there a function or keyword which can determine the size of an actual > > function from a reference to it? I've tried sizeof(), but it returns the > > size of the reference instead of the actual function. > > > > The way to do it is to declare a "null" function directly after the one you > want the size of, and then subtract the two pointers (I think). I _do_ know > that I saw this in the FAQ - it related to locking code in protected > mode. A word of caution is in order. If you use this technique, please be aware that you cannot be always sure that it will work. Subtle changes in compiler optimizations in some future release could rearrange functions and break this trick altogether.