This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH] Fix slow and non-deterministic behavior of isspace() and tolower()
- From: John Baldwin <jhb at FreeBSD dot org>
- To: Shawn Landden <shawn at git dot icu>, gdb-patches at sourceware dot org
- Date: Mon, 10 Jun 2019 14:13:58 -0700
- Subject: Re: [PATCH] Fix slow and non-deterministic behavior of isspace() and tolower()
- References: <20190609151704.16061-1-shawn@git.icu>
On 6/9/19 8:17 AM, Shawn Landden wrote:
> I was getting 8% and 6% cpu usage in tolower() and isspace(),
> respectively, waiting for a breakpoint on ppc64el.
>
> Also, gdb doesn't want non-deterministic behavior here.
These routines are not always macros. For example, FreeBSD's ctype.h
exposes these as functions for C++ and only as macros for pure C.
Perhaps it would be better to define custom functions that don't use
the POSIX names to avoid clashing with whatever libc provides if we
want something with very specific behavior.
--
John Baldwin