Path: utzoo!attcan!uunet!seismo!sundc!pitstop!sun!amdcad!ames!pasteur!ucbvax!dewey.soe.berkeley.edu!oster From: oster@dewey.soe.berkeley.edu (David Phillip Oster) Newsgroups: comp.sys.mac.programmer Subject: Re: 32K jump table limit Keywords: MacApp Message-ID: <25797@ucbvax.BERKELEY.EDU> Date: 25 Aug 88 07:49:25 GMT References: <3425@Portia.Stanford.EDU> Sender: usenet@ucbvax.BERKELEY.EDU Reply-To: oster@dewey.soe.berkeley.edu.UUCP (David Phillip Oster) Organization: School of Education, UC-Berkeley Lines: 40 The 4000 global procedure limit is a problem. There is a workaround in C and a workaround in pascal. In C, divide your program into modules, each module in its own files. All those procedures that are called only from within that module (and for a well written program, that should be most of the procedures, should be declared "static" which keeps them visible only inside that file, and on most compilers generated local jsrs that don't use the jump table. Of course, if you pass out pointers to procedures, they will get jump table entries whether you declare them static or not. In Pascal, define helper procedures lexically inside other procedures: procedure entry; procedure helper; begin { helper } ... end { helper } ; begin { entry } ... helper; helper; end {entry } ; Beware, if you pass a pointer to such a procedure to the operating system, it will not work. Beyond that, and you have to go to executable code resources that take an integer a function selector, like the PACKs do. Yes, it is a pain, but it is a chance to improve the style and maintainability of your code: It is easier to understand a program where the original author has been careful to delimit the scope of the procedures: If you know that procedure "x" is only called inside file "a", then you don't have to waste time thinking about the implications if it were called from file "b". --- David Phillip Oster --When you asked me to live in sin with you Arpa: oster@dewey.soe.berkeley.edu --I didn't know you meant sloth. Uucp: {uwvax,decvax,ihnp4}!ucbvax!oster%dewey.soe.berkeley.edu