diff options
author | Karl Williamson <khw@cpan.org> | 2020-12-06 15:01:14 -0700 |
---|---|---|
committer | Karl Williamson <khw@cpan.org> | 2020-12-19 22:00:30 -0700 |
commit | 03694582f8c247d4a1cc8a7bb8348af0173944d7 (patch) | |
tree | 663345306aa5475ca4758b0db7a5f026c410c865 /intrpvar.h | |
parent | 35bcf7ffa2bfeab79ab7b4eb0d35f462775b54d2 (diff) | |
download | perl-03694582f8c247d4a1cc8a7bb8348af0173944d7.tar.gz |
Fix broken PERL_MEM_LOG under threads
This fixes GH #18341
There are problems with getenv() on threaded perls wchich can lead to
incorrect results when compiled with PERL_MEM_LOG.
Commit 0b83dfe6dd9b0bda197566adec923f16b9a693cd fixed this for some
platforms, but as Tony Cook, pointed out there may be
standards-compliant platforms that that didn't fix.
The detailed comments outline the issues and (complicated) full solution.
Diffstat (limited to 'intrpvar.h')
-rw-r--r-- | intrpvar.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/intrpvar.h b/intrpvar.h index b11607bc79..f16d6dd3bc 100644 --- a/intrpvar.h +++ b/intrpvar.h @@ -1020,6 +1020,12 @@ PERLVAR(I, mbrtowc_ps, mbstate_t) #ifdef HAS_WCRTOMB PERLVAR(I, wcrtomb_ps, mbstate_t) #endif +#ifdef PERL_MEM_LOG +/* Enough space for the reserved byte, 1 for a potential leading 0, then enough + * for the longest representable integer plus an extra, the 3 flag characters, + * and NUL */ +PERLVARA(I, mem_log, 1 + 1 + TYPE_DIGITS(UV) + 1 + 3 + 1, char); +#endif /* If you are adding a U8 or U16, check to see if there are 'Space' comments * above on where there are gaps which currently will be structure padding. */ |