Path: utzoo!yunexus!geac!syntron!jtsv16!uunet!peregrine!elroy!ames!amdahl!pyramid!prls!philabs!ttidca!svirsky From: svirsky@ttidca.TTI.COM (William Svirsky) Newsgroups: comp.sys.ibm.pc Subject: Re: MIX Power C compiler (memory model names) Message-ID: <3040@ttidca.TTI.COM> Date: 12 Aug 88 15:51:45 GMT Article-I.D.: ttidca.3040 References: <22fc46fd@ralf> Reply-To: svirsky@ttidcc.tti.com (William Svirsky) Organization: Citicorp/TTI, Santa Monica Lines: 35 In article <22fc46fd@ralf> Ralf.Brown@B.GP.CS.CMU.EDU writes: }In article <3018@ttidca.TTI.COM>, I wrote: }}The compiler supports only what MIX calls an "enhanced medium model". }}What this means is that they take the standard medium model (unlimited }}code/64K data) and add an unlimited size heap. } }Sounds like what TurboC and probably everybody else calls "large model". The }large model uses unlimited code/64K global data/unlimited heap (all pointers }are 32-bits, but global data is accessed relative to DS for faster/smaller }code). "Huge model" uses one 64K global data segment per source file, but }this imposes extra overhead in loading DS on EVERY function entry. } }If MIX really has added an unlimited heap to the standard medium model, how }can the compiler tell whether to use 16-bit pointers (for the 64K data }segment) or 32-bit pointers (for the heap)? }-- You explicitly tell it so. In MIX Power C all data pointers are, by default, 16 bits. Power C supplies a set of functions to access the heap, such as: void far *farmalloc(unsigned long); char far *farstrcpy(char far *, char far *); etc. To access the heap you must use these functions and declare your pointers as far. Not as easy or transparent as large model, but more efficient, I would think, unless you are doing a great deal of heap access. Most, if not all, of the memory allocation and string handling functions are represented. -- Bill Svirsky, Citicorp+TTI, 3100 Ocean Park Blvd., Santa Monica, CA 90405 Work phone: 213-450-9111 x2597 svirsky@ttidca.tti.com | ...!{csun,psivax,rdlvax,retix}!ttidca!svirsky