[PATCH ggc] fix ggc_alloc_rtvec_resized

Laurynas Biveinis laurynas.biveinis@gmail.com
Tue Aug 16 15:31:00 GMT 2011


2011/8/16 Richard Guenther <richard.guenther@gmail.com>:
>> ggc_alloc_zone_vec_rtvec_def is for allocating an array of rtvec_def,
>> but you want a single (variable sized) rtvec_def, so
>> ggc_alloc_zone_rtvec_def is the correct function to call.
>
> I'm not so sure about that given the more strongly typing of our allocators.
> Laurynas?

Yes, in size calculations I totally forgot to check the allocator
itself. Andreas is right, the non-vector version is the one to use
here. It will happen to work with non-vector version right now too, as
currently both non-vector and vector allocators cast the result to the
same type, use the same underlying allocator and basically expand to
the same code.

The patch to adjust the definition is obvious/pre-approved if anyone's
inclined, or I'll just note in my TODO to fix this the next time I
commit something.

Thanks for pointing this out.
-- 
Laurynas



More information about the Gcc-patches mailing list