Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!uunet!seismo!gatech!bloom-beacon!oberon!cit-vax!elroy!ames!ucbcad!ucbvax!YALE.ARPA!LEICHTER-JERRY From: LEICHTER-JERRY@YALE.ARPA Newsgroups: comp.os.vms Subject: Re: Help Request Message-ID: <8707110230.AA28524@ucbvax.Berkeley.EDU> Date: Fri, 10-Jul-87 22:31:04 EDT Article-I.D.: ucbvax.8707110230.AA28524 Posted: Fri Jul 10 22:31:04 1987 Date-Received: Sun, 12-Jul-87 14:11:17 EDT Sender: daemon@ucbvax.BERKELEY.EDU Reply-To:Distribution: world Organization: The ARPA Internet Lines: 26 PROBLEM: I HAVE A FORTRAN PROGRAM WHICH NEEDS TO HANDLE AN AST. I WOULD LIKE TO LOCK IN MEMORY THE PAGES OF EITHER THE WHOLE PROGRAM OR MINIMALLY THOSE PARTS REQUIRED TO HANDLE THE AST (COMMON BLOCKS AND THE AST ROUTINE ITSELF) SO THAT THE RESPONSE TIME WILL BE QUICK. TO USE THE SYSTEM SERVICES LOCK PAGES IN MEMORY ROUTINE SYS$LCKPAG OR SYS$LKWSET I NEED TO KNOW THE ADDRESSES OF THE PAGES TO BE LOCKED. I DO NOT KNOW HOW TO USE SYSTEM ROUTINES (SYS$GETJPI??) TO FIND THESE ADDRESSES. The %LOC function allows you to obtain the address of a storage element, such as a variable in a common block. What you'd probably do is apply %LOC to a pair of variables, one at the beginning of the common block, one at the end. %LOC also works for external procedure names. The problem here is, that while the name of a function indicates where it begins, there is no real indication of where it ends. About the best you can do is use the address of the next function defined in the same source file, with the knowledge that there's probably no commitment anywhere that it is GUARANTEED to follow in memory - though it's a pretty safe assumption. (You have to make such assump- tions because you are inherently mixing a low-level, machine-address interface with a high-level compiler that assigns addresses outside of your control. For variables in COMMON, the language definition lets you force the compiler to use a particular ordering, but there is no analogous construct for code.) -- Jerry -------