Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!rphroy!teemc!sycom!ro-chp!chopps From: chopps@ro-chp.UUCP (Chris Hopps) Newsgroups: comp.sys.amiga.programmer Subject: Re: free() in SAS C Message-ID: Date: 8 May 91 03:35:24 GMT References: <1991May02.143148.22732@edb.tih.no> Organization: CHS Lines: 35 >In article chopps@ro-chp.UUCP (Chris Hopps) writes: >>In article <1991May02.143148.22732@edb.tih.no> karlm@epsilon.tih.no (Karl Martin Lund) writes: >> >>By ANSI def. you can only (m|c|re)alloc 64k blocks and less. > > Under ANSI malloc taks a size_t ... Maybe on an IBM-PC compiler you > are limited to 64K, but certainly not on Amiga and UNIX systems. > > -Matt Well SAS/C says the above, this doesn't mean its true though, I just took it as such. Page L20, volume II "By ANSI definition, calloc, malloc, and realloc can only allocate 64K at a time." But then I went to K&R second edition (certainly not exhaustive) and they said nothing about it. Just to be picky... yes malloc takes the type size_t as its only argument, but size_t is of type unsigned int, thus on the amiga, if you are using 16 bit ints the maximum is 65535 (64k) of course if you are using SAS/C defualt, int is defined as 32 bit, which is a much larger number, something to be aware of though. On this same point ANSI demands that type unsigned int's max value be at least 65535, but guarentees no more, thus if the strive is for portable code (why else would you use malloc :^) ) then 64k is a good assumption. Chris... -- ------------------------ The Royal Oak Chophouse Chris Hopps Royal Oak, Michigan ....umich!wsu-cs!ro-chp!chopps cs.wayne.edu!ro-chp!chopps