This is the mail archive of the gdb-patches@sourceware.cygnus.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: [RFC] Notes on QUIT and STREQ et.al.


> 
> I haven't looked to see how often (or where) STREQ and STRCMP are
> used, but these macros compare the first characters inline in an
> attempt to improve performance.  Have you assessed the benefits of
> doing this?  (If these optimizations significantly improve
> performance, I think they should stay.)

 I'll check out the performance.
I know GCC has a strlen expander, but no strcmp expander, so it might be a
benefit.


> 
> It seems to me that a decent STREQ macro should also test to see
> if the pointers are equal.  I.e,
> 
>    #define STREQ(a,b) ((a == b) || (*(a) == *(b) ? !strcmp ((a), (b)) : 0))
> 
> Kevin
> 


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]