Mail Archives: djgpp/1997/02/18/17:11:14
Errors-To: postmaster AT ns1
From: beppu AT rigel DOT oac DOT uci DOT edu (John Beppu)
Newsgroups: comp.os.msdos.djgpp
Date: 13 Feb 1997 20:54:09 GMT
Organization: University of California, Irvine
Lines: 19
Nntp-Posting-Host: rigel.oac.uci.edu
Dj-Gateway: from newsgroup comp.os.msdos.djgpp
Content-Type: text
Content-Length: 421
question 1 Is it safe to assume that memory allocated with
malloc() will be aligned on at least a 4 byte
boundary. (using djgpp)
question 2 Is it safe to assume the above will be true of
ports of gcc to other platforms?
question 3 ...and what about other non-gcc compilers?
[information,opinions] are appreciated.
It is safe to assume that any compliant "C" compiler will align malloc()
memory blocks to the most restrictive requirements of the native, or
target, processor. On Intel x86 in real mode this is 2byte alignment, in
intel x86 32 bit Protected mode this is 4byte alignment. For Motorola
88xx0 , for example, the alignment is 8byte alignment.
--
Art S. Kagel, kagel AT quasar DOT bloomberg DOT com
A proverb is no proverb to you 'till life has illustrated it. -- John Keats
- Raw text -