Skip to content

Commit 8239224

Browse files
committed
uchar: Remove thread locale annotation from static mbstate_t vars
The spec doesn't require that these state values be thread local, and that wastes memory for applications using them as intended. Signed-off-by: Keith Packard <[email protected]>
1 parent 4d27cd6 commit 8239224

File tree

6 files changed

+6
-6
lines changed

6 files changed

+6
-6
lines changed

newlib/libc/uchar/c16rtomb.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
size_t
3939
c16rtomb (char *s, char16_t c16, mbstate_t *ps)
4040
{
41-
static NEWLIB_THREAD_LOCAL mbstate_t local_state;
41+
static mbstate_t local_state;
4242

4343
if (ps == NULL)
4444
ps = &local_state;

newlib/libc/uchar/c32rtomb.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
size_t
3939
c32rtomb (char *s, char32_t c32, mbstate_t *ps)
4040
{
41-
static NEWLIB_THREAD_LOCAL mbstate_t local_state;
41+
static mbstate_t local_state;
4242

4343
if (ps == NULL)
4444
ps = &local_state;

newlib/libc/uchar/c8rtomb.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
size_t
3939
c8rtomb (char *s, char8_t c8, mbstate_t *ps)
4040
{
41-
static NEWLIB_THREAD_LOCAL mbstate_t _state;
41+
static mbstate_t _state;
4242
char32_t c32;
4343
int count;
4444

newlib/libc/uchar/mbrtoc16.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ size_t
3939
mbrtoc16(char16_t * __restrict pc16, const char * __restrict s, size_t n,
4040
_mbstate_t * __restrict ps)
4141
{
42-
static NEWLIB_THREAD_LOCAL mbstate_t local_state;
42+
static mbstate_t local_state;
4343

4444
if (ps == NULL)
4545
ps = &local_state;

newlib/libc/uchar/mbrtoc32.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
size_t mbrtoc32(char32_t * __restrict pc32, const char * __restrict s, size_t n,
3939
_mbstate_t * __restrict ps)
4040
{
41-
static NEWLIB_THREAD_LOCAL mbstate_t local_state;
41+
static mbstate_t local_state;
4242

4343
if (ps == NULL)
4444
ps = &local_state;

newlib/libc/uchar/mbrtoc8.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ size_t
3939
mbrtoc8(char8_t * __restrict pc8, const char * __restrict s, size_t n,
4040
mbstate_t * __restrict ps)
4141
{
42-
static NEWLIB_THREAD_LOCAL mbstate_t local_state;
42+
static mbstate_t local_state;
4343

4444
if (ps == NULL)
4545
ps = &local_state;

0 commit comments

Comments
 (0)