home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!psinntp!heimdall!thor!scjones
- From: scjones@thor.sdrc.com (Larry Jones)
- Newsgroups: comp.std.c
- Subject: Re: Is this allowed in C?
- Message-ID: <553@heimdall.sdrc.com>
- Date: 25 Jan 93 15:29:16 GMT
- References: <C17p4n.Dx8@undergrad.math.waterloo.edu> <1993Jan25.020122.22998@nntpd.lkg.dec.com>
- Sender: news@heimdall.sdrc.com
- Lines: 14
-
- In article <1993Jan25.020122.22998@nntpd.lkg.dec.com>, diamond@jit345.bad.jit.dec.com (Norman Diamond) writes:
- > The C standard guarantees that whenever malloc() succeeds, the value will
- > point to storage suitably aligned for everything, ....
-
- ...that is no larger than the amount of space allocated. Strictly
- speaking, if you only allocate 1 byte, the returned pointer need not
- be suitably aligned for types that are larger than 1 byte (e.g. int
- or double), since you can't store them there. Some implementations
- may take advantage of this to minimize the amount of wasted space,
- but most do not.
- ----
- Larry Jones, SDRC, 2000 Eastman Dr., Milford, OH 45150-2789 513-576-2070
- larry.jones@sdrc.com
- This game lends itself to certain abuses. -- Calvin
-