Path: utzoo!attcan!uunet!aplcen!haven!adm!smoke!bill From: bill@smoke.BRL.MIL (William E. Hatch) Newsgroups: comp.sys.mac Subject: C Port Questions Message-ID: <11736@smoke.BRL.MIL> Date: 4 Dec 89 03:03:15 GMT Reply-To: bill@smoke.brl.mil.UUCP (William E. Hatch) Organization: Ballistic Research Lab (BRL), APG, MD. Lines: 52 Subject: Mac C Question My current job assignment involves porting a moderate size (250K - 400K) C program from Xenix to a Macintosh II. The program only uses those library calls supported by ANSI C; it is a simple filter in that it reads several input files, performs many floating point computations and writes several output files. The program does not perform any graphics or interactive operations - there are no calls to the Macintosh toolbox or to any other Macintosh specific libraries. We plan to use Think C 4.0 as the Mac C compiler and code management system. In reviewing the Think C manuals, I discovered that the programmer is expected to hard code memory management logic and system calls because the "code" segment of the program is limited to 32 K. Furthermore, this is a Macintosh O/S limitation, not a limit imposed by Think C. Being very new to the Macintosh world, I never expected that a 68030 machine with demand paging hardware and 4 to 8 Mb of RAM would be so limited in the size of programs supported. We can break the code up into 16 or more 32 K segments; however, the labor costs incurred will overrun the fixed price contract by about 30%, and the source code packaging (into files) will become highly unstructured. We are using calloc() to allocate all arrays and data structures so that these will not reside in the code segment. There are no arrays or data structures greater than 32K. The code for the inner loop of the program is highly likely to require a code segment greater than 32K. My questions are as follows: 1.) Will this 32K code segment (and other related 32K limitations) be removed in the next version of the Macintosh O/S (7.0 i think) ? 2.) Are we using the right C development system (Think C 4.0)? Do other development systems such as MPW currently provide a workaround that is transparent to the programmer? 3.) If the 32K limitation is removed in 7.0, how soon will a compatible C development system be available (MPW or Think C) ? Any answers or recommendations will be greatly appreciated. The mail address on my home machine is: uunet!bts!bill Thanks in advance. Bill Hatch Computational Engineering 14504 Greenview Drive Suite 500 Laurel, Maryland 20708 Phone (301)470-3839 FAX (301)776-5461 HOME (301)441-1675