On Wed, 9 Aug 2000, Marcus Meissner wrote:
> On Wed, Aug 09, 2000 at 02:33:36AM -0400, Jim Aston wrote:
> >
> > I'm profiling Wine with cprof http://opensource.corel.com/cprof.html
> > and I am curious as to why lstrlenA has a __TRY, __EXCEPT wrapper
> > around a strlen call. The exception handling is 2/3 of the execution time.
> > I also noticed that the exception handling isn't used outside the string
> > functions. lstrlenA is in the top 20 function calls.
>
> The reason is that some windows apps pass NULL pointers and expect
> ERROR_INVALID_PARAMETER to be returned, and not a Dr. Watson pop-up ;)
If you've already got a wrapper for strlen(), why use additional exception
handling for this case? Couldn't you save a lot of overhead by using an
"if" in the wrapper to check for NULL pointers?
Deven