From: firewind Newsgroups: comp.os.msdos.djgpp Subject: Re: Locking in C++. Date: 6 Oct 1997 23:04:48 GMT Organization: Netcom Lines: 28 Message-ID: <61bqqg$q1r@dfw-ixnews12.ix.netcom.com> References: <3 DOT 0 DOT 16 DOT 19971003194523 DOT 2bf769ac AT hem1 DOT passagen DOT se> NNTP-Posting-Host: elp-tx1-09.ix.netcom.com Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 8bit To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Precedence: bulk Peter Palotas wrote: > I wonder if there is some way to lock a memberfunction of a class in DJGPP. > I know an ordinary function can (strangely enough), as it seems, be locked > by creating a dummy function right after the function you want to lock. But > does this work for a member-function of a class too? (I somehow doubt that). > Isn't there any other way to find out the size of a function? Or can you > put a member function of a class in a specific code-segment and then lock > the entire segment? (Maybe one can lock an entire class in one step?)... I haven't tried it, but I'm rather unsure that the tradition dummy function trick would work. Your only alternative, I believe, is to patch gcc to support sections as an __attribute__, put everything you need to lock in a single section, and lock the whole thing. Patches (including a pre-recompiled :) binary) and instructions for using and locking sections can be found at Alaric B. William's web site: http://www.abwillms.demon.co.uk/prog/index.htm HTH! -- [- firewind -] [- email: firewind AT metroid DOT dyn DOT ml DOT org (home), firewind AT aurdev DOT com (work) -] [- "You're just jealous because the voices talk to -me-." -]