[PATCH] Use binary search instead of linear search in corefile.c of gprof

Tristan Gingold gingold@adacore.com
Mon Jun 15 13:20:00 GMT 2009


On Jun 15, 2009, at 3:11 PM, Dongsheng Xing wrote:

>
> Hi!
>
>    This patch replace linear search by binary search in  
> core_create_syms_from().
>
>    This is implemented by qsort(symbol_map) in  
> read_function_mappings() by function name, thus we can do binary  
> search in core_create_function_syms() based on function name.

Just being curious: if you sort with qsort(), why don't you search  
with bsearch() ?



More information about the Binutils mailing list