On Thu, Jun 13, 2024 at 10:36 PM Zheng Yejian <zhengyeji...@huawei.com> wrote:
>
> Array 'table' is used to store pointers of symbols that read from in.map
> file, and its size depends on the number of symbols. Currently 'table'
> is expanded by calling realloc() every 10000 symbols read.
>
> However, there generally are around 100000+ symbols, which means that
> the expansion is generally 10+ times.
>
> As an optimization, introduce linked list 'sym_list' to associate and
> count all symbols, then store them into 'table' at one time.
>
> Signed-off-by: Zheng Yejian <zhengyeji...@huawei.com>


I do not think this is worthwhile.

realloc() is simple.

If this is a problem, you can increase the
"+= 10000" to "+= 65536" or something.







-- 
Best Regards
Masahiro Yamada

Reply via email to