home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #3 / NN_1993_3.iso / spool / comp / std / c / 3413 < prev    next >
Encoding:
Internet Message Format  |  1993-01-25  |  1.1 KB

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