Solaris has a memalign() function which allows you to allocate memory on a specified alignment boundary. If you are not on Solaris, your OS might also have memalign(). Adam Stein -- Adam Stein @ Xerox Corporation Email: adam@xxxxxxxxxxxxxxxxx Disclaimer: All views expressed here have been proved to be my own. [http://www.csh.rit.edu/~adam/] >Mailing-List: contact gcc-help-help@xxxxxxxxxxx; run by ezmlm >List-Unsubscribe: <mailto:gcc-help-unsubscribe-adam=scan.mc.xerox.com@xxxxxxxxxxx> >List-Archive: <http://gcc.gnu.org/ml/gcc-help/> >List-Post: <mailto:gcc-help@xxxxxxxxxxx> >List-Help: <mailto:gcc-help-help@xxxxxxxxxxx> >Delivered-To: mailing list gcc-help@xxxxxxxxxxx >X-Authentication-Warning: CSPC201.joensuu.fi: kfredrik owned process doing -bs >Date: Tue, 12 Aug 2003 12:02:58 +0000 (UTC) >From: Kimmo Fredriksson <kfredrik@xxxxxxxxxxxxx> >X-X-Sender: kfredrik@xxxxxxxxxxxxxxxxxx >To: gcc-help@xxxxxxxxxxx >Subject: mallocating 16 byte aligned blocks... >replyto: Kimmo Fredriksson <kfredrik@xxxxxxxxxxxxx> >X-Spam-Status: No, hits=-5.6 required=5.0 tests=BAYES_00,USER_AGENT_PINE,X_AUTH_WARNING version=2.55-iset1 >X-Spam-Level: >X-Spam-Checker-Version: SpamAssassin 2.55-iset1 (1.174.2.19-2003-05-19-exp) > >Hi, > >I need to malloc blocks of memory that are quaranteed to be aligned to 16 >byte boundaries. Should I write my own version of malloc, or is there a >simpler way to achieve this? > >kf >