Re: Refactor to introduce pg_strcoll(). - Mailing list pgsql-hackers

From Jeff Davis
Subject Re: Refactor to introduce pg_strcoll().
Date
Msg-id 81bebda79b605cea82ce5144a8ff51f29af4611c.camel@j-davis.com
Whole thread Raw
In response to Re: Refactor to introduce pg_strcoll().  (Peter Eisentraut <peter.eisentraut@enterprisedb.com>)
Responses Re: Refactor to introduce pg_strcoll().
List pgsql-hackers
On Thu, 2022-10-13 at 10:57 +0200, Peter Eisentraut wrote:
> It's a bit confusing that arguments must be NUL-terminated, but the
> length is still specified.  Maybe another sentence to explain that
> would
> be helpful.

Added a comment. It was a little frustrating to get a perfectly clean
API, because the callers do some buffer manipulation and optimizations
of their own. I think this is an improvement, but suggestions welcome.

If win32 is used with UTF-8 and wcscoll, it ends up allocating some
extra stack space for the temporary buffers, whereas previously it used
the buffers on the stack of varstr_cmp(). I'm not sure if that's a
problem or not.

> The length arguments ought to be of type size_t, I think.

Changed.

Thank you.


--
Jeff Davis
PostgreSQL Contributor Team - AWS



Attachment

pgsql-hackers by date:

Previous
From: Cary Huang
Date:
Subject: Re: Avoid memory leaks during base backups
Next
From: Corey Huinker
Date:
Subject: Re: predefined role(s) for VACUUM and ANALYZE