Path: utzoo!utgpu!water!watmath!clyde!att!ucbvax!husc6!rutgers!apple!lsr From: lsr@Apple.COM (Larry Rosenstein) Newsgroups: comp.sys.mac.programmer Subject: Re: 32K jump table limit Keywords: MacApp Message-ID: <16326@apple.Apple.COM> Date: 30 Aug 88 06:12:42 GMT References: <3425@Portia.Stanford.EDU> Reply-To: lsr@apple.com.UUCP (Larry Rosenstein) Organization: Advanced Technology Group, Apple Computer Lines: 46 In article <3425@Portia.Stanford.EDU> rick@jessica.stanford.edu (Rick Wong) writes: > >Does anyone have any suggestions for dealing with this problem? >(This looks like a job for Apple.) This has been discussed at length on AppleLink. Unfortunately, there is no quick workaround. Object Pascal uses jump table entries as method and class IDs. Also, the method tables themselves contain the jump table offset for the method code. (I believe that there will be one jump table entry for each class, for each newly-defined method, and for each implementation of a method.) This was done primarily as an implementation convenience. When you optimize, the class IDs are assigned by the linker in sequence (no jump table entry needed), and many entries in the method tables are eliminated. This greatly reduces the number of jump table entries required. So one workaround is to always build an optimized version of your program. (I believe that the MacApp team is investigating whether it is possible to optimize an application, but still keep the MacApp debugger. This has not been done for the MacApp 2.0 beta release.) The linker only creates jump table entries when it has to. If a routine is only referenced from within its segment, then there is no need for a jump table entry. Combining some of your segments may help a bit, if they contain regular procedures and functions (not methods). I didn't think that MPW Pascal allocated a jump table entry for every procedure parameter. What you may be seeing is the fact that some MacApp units contain a {$B-} compiler flag to force all procedure references to have jump table entries. I think that the MacApp team has removed these directives from the MacApp 2.0 sources. You can add {$B+} directives to your units to tell the linker to use PC-relative addressing. (We put the $B- flag in to ensure that MacApp didn't save a PC-relative address away. This turned out to be overkill.) The problem is recognized by the MacApp team, and they are looking at ways to solve the problem. I agree that it is unfortunate for programmers to have to worry about this. Larry Rosenstein, Object Specialist Apple Computer, Inc. 20525 Mariani Ave, MS 46-B Cupertino, CA 95014 AppleLink:Rosenstein1 domain:lsr@Apple.COM UUCP:{sun,voder,nsc,decwrl}!apple!lsr