From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 10448 invoked by alias); 24 Sep 2004 08:40:37 -0000 Mailing-List: contact gcc-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-owner@gcc.gnu.org Received: (qmail 10441 invoked from network); 24 Sep 2004 08:40:36 -0000 Received: from unknown (HELO mail.codesourcery.com) (65.74.133.10) by sourceware.org with SMTP; 24 Sep 2004 08:40:36 -0000 Received: (qmail 19164 invoked from network); 24 Sep 2004 08:40:36 -0000 Received: from 82-32-50-9.cable.ubr07.azte.blueyonder.co.uk (HELO codesourcery.com) (nathan@82.32.50.9) by mail.codesourcery.com with RC4-MD5 encrypted SMTP; 24 Sep 2004 08:40:36 -0000 Message-ID: <4153DD7C.2040205@codesourcery.com> Date: Fri, 24 Sep 2004 12:24:00 -0000 From: Nathan Sidwell Organization: Codesourcery LLC User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.4) Gecko/20030624 MIME-Version: 1.0 To: Geoffrey Keating CC: Giovanni Bajo , gcc@gcc.gnu.org Subject: Re: attribute data structure rewrite References: <007a01c4a1de$78b66ed0$dc4e2a97@bagio> <6832D6AE-0DF5-11D9-B012-000A95B1F520@apple.com> In-Reply-To: <6832D6AE-0DF5-11D9-B012-000A95B1F520@apple.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-SW-Source: 2004-09/txt/msg01417.txt.bz2 Geoffrey Keating wrote: > > On 23/09/2004, at 7:30 PM, Giovanni Bajo wrote: >> Why not simply VEC(one_attribute) ? > > > VECs are much too much for what's needed here. They're expandable, they > can be used as a stack, all kinds of stuff (and all kinds of data) that > aren't necessary. The extra data they have over your implementation is an 'allocated' field. And the alloc and num fields are ints, rather than shorts. It would not be difficult to have additional defining macros which specified 'this never grows to more that 16,000 entries'. If that was done, it would become the exact same size as your data structure, and you'd get the same API as other vectors, rather than a new bespoke API for your need. I'd much prefer the same API for all vector-like things. nathan -- Nathan Sidwell :: http://www.codesourcery.com :: CodeSourcery LLC nathan@codesourcery.com :: http://www.planetfall.pwp.blueyonder.co.uk