🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.std.c
Article #3296

Re: Is this allowed in C?

#3296
From: Larry Jones
Date: Mon, 25 Jan 1993 15:29
14 lines
1130 bytes
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
Technical Details
Message-ID: <553@heimdall.sdrc.com>
Path: arc1-ca.pugleaf.net!sparky!uunet!psinntp!heimdall!thor!scjones
References: <C17p4n.Dx8@undergrad.math.waterloo.edu> <1993Jan25.020122.22998@nntpd.lkg.dec.com>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!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