Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!swrinde!zaphod.mps.ohio-state.edu!sol.ctr.columbia.edu!cica!iuvax!ux1.cso.uiuc.edu!aries.scs.uiuc.edu!mcdonald From: mcdonald@aries.scs.uiuc.edu (Doug McDonald) Newsgroups: comp.sys.mac.programmer Subject: Re: Mac C Compiler? Message-ID: <1990Sep27.031854.15347@ux1.cso.uiuc.edu> Date: 27 Sep 90 03:18:54 GMT References: <1990Sep24.184845.12502@ux1.cso.uiuc.edu> <1990Sep26.225549.17792@midway.uchicago.edu> Sender: news@ux1.cso.uiuc.edu (News) Organization: Univ. of Illinois at Urbana-Champaign, Chemical Sciences Lines: 40 In article <1990Sep26.225549.17792@midway.uchicago.edu> francis@arthur.uchicago.edu (Francis Stracke) writes: >In article <1990Sep24.184845.12502@ux1.cso.uiuc.edu> mcdonald@aries.scs.uiuc.edu (Doug McDonald) writes: >> >[...] >>I tried compiling this on the Mac with a borrowed copy of Lightspeed C >>and it failed. These are large programs - a couple of megabytes >>of global data and several very large subroutines (that compile to >>somewhere between 50 and 125 kbytes of code on varying computers). >>Lightspeed C apparently thinks it is too big. > >Damn straight, it's too big! Macs use a variety of segmenting that puts each >segment of your program into its own code resource (if you don't know, don't >worry). No resource can be bigger than 32K (theoretically--I've seen some >sound resources get around it somehow--but it's probably tricky and risky >enough that no compiler would do it, especially with work-arounds available-- >see below). No subroutine can be spread across more than one segment >(reasonable, no?). Therefore, no subroutines over 32K. > >What you need to do is break up those subroutines, so that their pieces come out >less than 32K each, then put pieces into separate segments. No way Jose - I'm not about to try that sort of crap. I did once try it and I still thank God that I already owned lots of stock in a company that sells Aspirin :-(. >What are >you doing with routines that big, anyway? That what it takes to express the logic of the program. Haven't you ever seen an expression that takes 20 lines? Some of these things might have 300 expressions that big. Ever seen a subroutine that calls sin or cos 5000 times? I have. > >BTW: the reason resources aren't supposed to be over 32K is that their sizes are >expressed as integers (maxint=32767). Guess I'll just have to fork over for a CD-ROM reader for my PC - It happily generates subroutines over 100 kilobytes long. Doug McDonald