machines. I have just been observing some scenarios where set_ps_display
accounts for more than 10% of the backend CPU, and this loop has to be
the reason.
#ifdef PS_USE_CLOBBER_ARGV
{
- char *cp;
+ int buflen;
/* pad unused memory */
- for (cp = ps_buffer + strlen(ps_buffer);
- cp < ps_buffer + ps_buffer_size;
- cp++)
- *cp = PS_PADDING;
+ buflen = strlen(ps_buffer);
+ MemSet(ps_buffer + buflen, PS_PADDING, ps_buffer_size - buflen);
}
#endif /* PS_USE_CLOBBER_ARGV */
#endif /* not PS_USE_NONE */