[Bug middle-end/37448] patch to compute alloc-pool stats correctly
Kenneth Zadeck
zadeck@naturalbridge.com
Tue Oct 7 16:40:00 GMT 2008
Ian Lance Taylor wrote:
> Kenneth Zadeck <zadeck@naturalbridge.com> writes:
>
>
>> 2008-09-26 Kenneth Zadeck <zadeck@naturalbridge.com>
>>
>> PR rtl-optimization/37448
>> alloc_pool_desc (elt_size): New field.
>> alloc-pool.c (create_alloc_pool, empty_alloc_pool, pool_alloc,
>> pool_free): Properly keep track of desc->size.
>> (print_statistics, dump_alloc_pool_statistics): Enhance the
>> printing of statistics to print the number of elements.
>>
>
>
>
>> -/* Store information about each particular alloc_pool. */
>> +/* Store information about each particular alloc_pool. Note that this
>> + will underestimate the amount the amount of storage used by a small amount:
>> + 1) The overhead in a pool is not accounted for.
>> + 2) The unallocated elements in a block are not accounted for. Note
>> + that this can at worst case be one element smaller that the block
>> + size for that pool.
>> +*/
>>
>
> Please put the */ at the end of the previous line.
>
>
of course.
> I wonder if some of the types in alloc_pool_descriptor should be
> size_t rather than int, though it's hard to imagine it making a
> difference in real life.
>
>
I noticed this too, it actually does make a difference in the printing
of the values on the testcase since they overflow. However, I did not
know how to modify the formats in the printfs to print the size_ts.
Kenny
> OK with that change.
>
> Thanks.
>
> Ian
>
More information about the Gcc-patches
mailing list