Path: utzoo!attcan!uunet!lll-winken!lll-tis!ames!mailrus!purdue!decwrl!labrea!Portia!Jessica!rick From: rick@Jessica.stanford.edu (Rick Wong) Newsgroups: comp.sys.mac.programmer Subject: Re: 32K jump table limit Keywords: MacApp Message-ID: <3435@Portia.Stanford.EDU> Date: 25 Aug 88 18:37:21 GMT References: <3425@Portia.Stanford.EDU> <25797@ucbvax.BERKELEY.EDU> Sender: news@Portia.Stanford.EDU Reply-To: rick@Jessica.stanford.edu (Rick Wong) Organization: Stanford University Lines: 51 In article <25797@ucbvax.BERKELEY.EDU> oster@dewey.soe.berkeley.edu.UUCP (David Phillip Oster) writes: >The 4000 global procedure limit is a problem. There is a workaround in C >and a workaround in pascal. > [stuff about workarounds in C and Pascal] >--- David Phillip Oster --When you asked me to live in sin with you Sorry I didn't make myself clear enough. I'm programming primarily in Object Pascal (using MacApp). Although the jump table limit may be tractable for "traditional" languages, it is not for Object Pascal. MacApp encourages a particular programming style: -- Its error-recovery mechanism requires you to pass a procedure parameter to a failure-handling routine. MPW Pascal allocates a jump table entry for all procedure parameters, regardless of whether they are nested. -- When you write a new class, there are certain methods you almost always have to define, notably initializing, freeing, and inspect- ing methods. For deep class hierarchies, with additional proto- cols layered one on top of the other, this can get significant. -- Objects often have attributes you want access to. I consider directly manipulating an object's fields bad style, so I try to write methods that provide a clean interface for accessing object attributes. Writing lots of "Get..." and "Set..." methods quickly eats up jump table entries. -- For the user to do something to an object (e.g., drag, cut), MacApp requires you to create a separate "command" object for each operation (MacApp uses commands to implement its "Undo" protocol). Commands typically have about ten methods (DoIt, UndoIt, RedoIt, etc.). It's not uncommon for units defining fairly sophisticated objects to have on the order of 100 method definitions. Here's the kicker: Apple's implementation of method dispatching uses a jump table entry for EVERY method, regardless of whether it's only called from within the same segment. 4091 is not a large number. 8-( The only real solutions to this problem have to come from Apple, or some other development system developer (Think?). Either Object Pascal's method dispatching needs to be redesigned so it doesn't rely on the jump table, or the 32K jump table limit has to be lifted. Rick Wong Courseware Authoring Tools Project, Stanford University