From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,39573b6047875874 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2003-01-22 14:50:00 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!logbridge.uoregon.edu!kibo.news.demon.net!news.demon.co.uk!demon!not-for-mail From: Simon Wright Newsgroups: comp.lang.ada Subject: Re: Unchecked_Conversion and alignment Date: 22 Jan 2003 22:49:08 +0000 Organization: Pushface Sender: simon@smaug.pushface.org Message-ID: References: <3e2cf0e4$0$33922$bed64819@news.gradwell.net> <3e2da295$0$33922$bed64819@news.gradwell.net> NNTP-Posting-Host: pogner.demon.co.uk Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: news.demon.co.uk 1043275797 1580 62.49.19.209 (22 Jan 2003 22:49:57 GMT) X-Complaints-To: abuse@demon.net NNTP-Posting-Date: Wed, 22 Jan 2003 22:49:57 +0000 (UTC) User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.1 Xref: archiver1.google.com comp.lang.ada:33358 Date: 2003-01-22T22:49:08+00:00 List-Id: porton@ex-code.com (Victor Porton) writes: > > It would help if you said why you want to keep object in arrays of > > Storage_Elements. > > I make my own storage pool which uses the standard pool. > > I allocate by "new Storage_Array(1..XXX)". When you are called as procedure Allocate (The_Pool : in out Pool; Storage_Address : out System.Address; Size_In_Storage_Elements : SSE.Storage_Count; Alignment : SSE.Storage_Count); you need to make sure that you allocate enough extra that you can start the returned Storage_Address at the correct alignment. Something like Size_In_Storage_Elements + (Alignment - (Size_In_Storage_Elements mod Alignment)) (I haven't thought about that a lot, let alone tried to compile it). Of course your system new will give you some alignment for free (typically 16?)