attribute data structure rewrite
Nathan Sidwell
nathan@codesourcery.com
Fri Sep 24 12:24:00 GMT 2004
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
More information about the Gcc
mailing list