Xref: utzoo comp.sys.mac.programmer:4468 comp.lang.c:16211 Path: utzoo!utgpu!watmath!clyde!ima!haddock!suitti From: suitti@haddock.ima.isc.com (Stephen Uitti) Newsgroups: comp.sys.mac.programmer,comp.lang.c Subject: Re: Mac LightSpeed C question (elementary) Message-ID: <11746@haddock.ima.isc.com> Date: 13 Feb 89 18:02:52 GMT References: <1158@naucse.UUCP> Reply-To: suitti@haddock.ima.isc.com (Stephen Uitti) Organization: Interactive Systems, Boston Lines: 31 In article <1158@naucse.UUCP=> rrw@naucse.UUCP (Robert Wier) writes: =>... LightSpeed C: => => There appears to be a 32k limit on data structures. I have => gotten around this problem in Pascal programs by doing allocate and => dispose operations. Is there something equivalent in C? mlalloc(). One would normally use malloc(), but malloc historically takes an "int" - which is 16 bits in LSC. mlalloc() takes a long. I have written stuff with 300KB arrays in LSC. It can be a little tricky debugging it, due to memory (or lack thereof) problems. Many people use the Mac OS calls to do memory stuff. I try to use standard C where I can. I've always thought of malloc() as part of the language. PC's solve this with farmalloc() - sigh. I vaguely recall having to declare void *mlalloc(); so that the cast would work right. => Or is there => a more elegant technique (for example, on researcher here would like => to have a 512 * 512 array). Maybe something like: foo = mlalloc(sizeof(int[512][512])); if (foo == NULL) abort(); /* or whatever, but check! */ foo[30][25] = 6; => Not being a C programmer, I would appreciate an answer in words of => one syallable :-). => -Bob Wier Sorry, mlalloc() has more than that. The manual describes it, though. Watch for include files, libraries, etc. Always use prototypes. Stephen.