| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
We want to use C11 thread local storage where possible, as its read overhead
is lower. However C++ uses incompatible syntax for TLS, so we have to hide
the variable from C++ extensions, and have the read code "fall back" to the
pthread_getspecific() approach.
However, C++ extensions also need to be able to call PERL_SET_CONTEXT(t) and
have everything still work the same as C extensions. Hence they *also* need
to set PL_current_context - a variable that has to be hidden from them.
Hence change the version of the PERL_SET_CONTEXT macro used by C++
extensions from inline code to a call to Perl_set_context(), and have that
set PL_current_context (when used).
Technically this commit also fixes a bug in that Perl_set_context() is API
and should have been setting PL_current_context since that variable was
first introduced. In practice, likely nothing uses this API, as there is no
code on CPAN that calls it, and the macro PERL_SET_CONTEXT() is much more
prominent.
|
|
|
|
|
|
|
| |
Add code to change the file descriptor on the file descriptors opened from
``Perl_my_popen_list`` and ``Perl_my_popen`` so that the CCSID of the file
descriptor is 819. This change is only when the code is built for
ASCII ``#if (__CHARSET_LIB == 1)`` on z/OS ``#if defined(OEMVS)``.
|
| |
|
|
|
|
|
|
| |
DJGPP is a port of the GNU toolchain to 32-bit x86 systems running DOS.
The last known attempt to build Perl on it was on 5.20, which only got
as far as building miniperl.
|
|
|
|
| |
The build has been broken since 2009.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
xs_handshake() makes two different comparisons that on failure are reported
as "got handshake key %p, needed %p", with opaque hexadecimal values.
The first is the "actual" key as generated by the HS_KEY() macro, which
encodes various values such as sizeof(PerlInterpreter) and the API version.
The second is the address of the current thread's PerlInterpreter struct.
Either can fail, and before this commit they would fail with identical text.
Hence it wasn't obvious what the problem was, causing "confusion and delay"
if one tried to decode the hexadecimal output as the wrong thing. (For
example when it's actually pointers mismatching, but one tries to decode the
values into API version and structure size, assuming that the values were
the packed output from HS_KEY().)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
In Perl_my_pclose() the code as been calling av_fetch() with TRUE (lvalue;
create the SV if not found) since the Perl 4 -> Perl 5 migration. The
code *had* been assuming that the returned result was always a valid SvIV
until commit 25d9202327791097 in Jan 2001:
Safe fix for Simon's pclose() doing SvIVX of undef -> core bug.
which fixes the bug reported in
https://www.nntp.perl.org/group/perl.perl5.porters/2001/01/msg28651.html
That commit changed the code to default the IV result (the pid) to -1 if the
av_fetch() failed to return SVt_IV. However, that commit failed to notice
that the value -1 was *already* "in use" *only 4 lines later* as a flag for
OS/2 to indicate "Opened by popen."
Hence switch the OS/2 sentinel value to -2.
The that states that OS/2 has a my_pclose implementation in os2.c is wrong.
It was erroneously added by commit 5f05dabc4054964a in Dec 1996:
[inseparable changes from patch from perl5.003_11 to perl5.003_12]
It appears to be a copy-paste error from the previous comment added about
my_popen.
I tested this fix with the 2001-era code of commit 25d9202327791097 - it
(also) solves the bug reported back then.
|
|
|
|
|
|
|
|
|
|
|
|
| |
Since the removal of PERL_OBJECT
(acfe0abcedaf592fb4b9cb69ce3468308ae99d91) PERL_IMPLICIT_CONTEXT and
MULTIPLICITY have been synonymous and they're being used interchangeably.
To simplify the code, this commit replaces all instances of
PERL_IMPLICIT_CONTEXT with MULTIPLICITY.
PERL_IMPLICIT_CONTEXT will stay defined for compatibility with XS
modules.
|
|
|
|
|
|
|
|
|
|
| |
The strftime() format %p yields an am/pm indicator. Many locales don't
have this distinction, and so a format containing just this specifier
will return an empty string. Prior to this commit, that was considered
an error. What was going on is we kept enlarging the buffer to find a
non-empty return, to no avail, and so treat it as an error. This commit
special cases this to not make it an error. (It's hard to imagine that
the am/pm string alone would exceed the 200 byte limit.)
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
This just detabifies to get rid of the mixed tab/space indentation.
Applying consistent indentation and dealing with other tabs are another issue.
Done with `expand -i`.
* vutil.* left alone, it's part of version.
* Left regen managed files alone for now.
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This fixes GH #18341
The Perl wrapper for getenv() was changed in 5.32 to allocate memory to
squirrel safely away the result of the wrapped getenv() call. It does
this while in a critical section so as to make sure another thread can't
interrupt it and destroy it.
Unfortunately, when Perl is compiled for debugging memory problems and
has PERL_MEM_LOG enabled, that allocation causes a recursive call to
getenv() for the purpose of checking an environment variable to see how
to log that allocation. And hence it deadlocks trying to enter the
critical section.
There are various solutions. One is to use or emulate a general semaphore
instead of a binary one. This is effectively what
PL_lc_numeric_mutex_depth does for another mutex, and the code for that
could be used as a template.
But given that this is an extreme edge case which requires Perl to be
specially compiled to enable this feature which is used only for
debugging, a much simpler, if less safe if it were to ever be used in
production, solution should suffice. Tony Cook suggested just avoiding
the wrapper for this particular purpose.
|
|
|
|
| |
into Debugging and Display sections
|
|
|
|
|
|
|
|
|
|
|
| |
This feature allows documentation destined for perlapi or perlintern to
be split into sections of related functions, no matter where the
documentation source is. Prior to this commit the line had to contain
the exact text of the title of the section. Now it can be a $variable
name that autodoc.pl expands to the title. It still has to be an exact
match for the variable in autodoc, but now, the expanded text can be
changed in autodoc alone, without other files needing to be updated at
the same time.
|
|
|
|
|
|
| |
I modified this function in ab01742544b98b5b5e13d8e1a6e9df474b9e3005,
and did not fully understand the edge cases. This commit now handles
those properly, the same as plain delimcpy() does.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Prior to this commit delimcpy() parsed its input byte-by-byte, looking
for a particular character, and copied the input to the output stopping
just before the first such occurrence.
memchr() is much faster for finding a single character.
The complication is that if the character is preceded by a backslash,
it doesn't count as that character, it is considered to be escaped, and
parsing continues to the first unescaped occurrence, if any. Each
escaping backslash is not copied.
The prior code also failed to account for the possibility of the delimiter
being a backslash, the same as the escape.
The new routine looks for the character with memchr, sees if it is
escaped. If not, Copy does the whole copy at once. If it is escaped,
it uses Copy up to that backslash, and repeats the process.
|
|
|
|
|
|
|
|
|
| |
For: https://github.com/Perl/perl5/pull/18201
Committer: Samanta Navarro is now a Perl author.
To keep 'make test_porting' happy: Increment $VERSION in several files.
Regenerate uconfig.h via './perl -Ilib regen/uconfig_h.pl'.
|
|
|
|
| |
When you are about to die, the time/space tradeoff may tilt towards space.
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
| |
This uses a new organization of sections that I came up with. I asked
for comments on p5p, but there were none.
|
|
|
|
| |
These weren't indented so weren't treated as verbatim
|
| |
|
|
|
|
| |
These just refer to foo's pod, with an explanation of 'nocontext'
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
This function finds a needle in a haystack.
If memrchr() is available, use it to find the final byte in the needle;
If the needle is length 1, that's all we need, and this is special
cased. Otherwise it uses memEQ of the other bytes of the needle, from
where the needle would have to start, and if no match, repeats.
If no memrchr(), it emulates that by just looking backward from the end
until it finds the needle's final byte; then proceeds as above.
|
| |
|
|
|
|
|
| |
This function is perl's memmem if that function isn't available. This
commit replaces its loop with a call to memchr, which is a C89 function.
|
|
|
|
|
|
|
|
| |
This was doing a byte-by-byte search and copy. We can make things
simpler and faster by
1) only looking within the available space region
2) using memchr for seach
3) using Copy to copy the whole thing at once.
|
|
|
|
| |
This will make some future commits a little less noisy
|
|
|
|
|
|
|
|
|
| |
These functions were only part of the API if perl is built with clang.
However perl modules built with clang still try to use them even
when perl itself is built with gcc. This patch replaces the #ifdef PERL_TSA_ACTIVE
around these functions with defined(USE_ITHREADS) && defined(I_PTHREAD)
so they are always available when treading is enabled. This fixes the clang build of
perl modules when perl is built with gcc.
|
|
|
|
|
| |
It only does anything under PERL_GLOBAL_STRUCT, which is gone.
Keep the dNOOP defintion for CPAN back-compat
|
|
|
|
|
|
|
|
| |
This was originally added for MinGW, which no longer needs it, and
only still used by Symbian, which is now removed.
This also leaves perlapi.[ch] empty, but we keep the header for CPAN
backwards compatibility.
|
|
|
|
|
| |
Also eliminate USE_HEAP_INSTEAD_OF_STACK and
SETSOCKOPT_OPTION_VALUE_T, since Symbian was the only user of those.
|
|
|
|
|
| |
This hasn't actually been used since commit
8922e4382e9c1488fdbe46a0f52493860dc897a6.
|
|
|
|
|
|
| |
Instead, do a translation of the ASCII one at runtime. This is because
the table doesn't account for the various EBCDIC flavors, so isn't
actually accurate.
|
|
|
|
|
|
|
| |
Commit b001a0d149ed99df18916796f3a72b2c888b94d8 changed it to bumping
the size from 0 to 1 earlier in the function, but didn't remove the
then-redundant ternary that tried to avoid passing zero to
PerlMem_malloc().
|
|
|
|
|
| |
Mostly in comments and docs, but some in diagnostic messages and one
case of 'or die die'.
|
|
|
|
|
| |
Sprinkle some dVAR pixie dust to fix recent bitrot on that build
configuration.
|
|
|
|
|
|
| |
This locks around localtime (and localtime_r which this call may be
translated into) which are sensitive to locale and environment changes
in their execution.
|
|
|
|
| |
introduced by cd7ac46508e1b2b346c339417237ef487bf59c74
|
| |
|
|
|
|
|
|
|
| |
This reverts commit 6c714a09cc08600278e72aea1fcdf83576d061b4.
croak_memory_wrap is designed to save a few bytes of memory, and was
never intended to be inlined. This commit moves it to util.c where the
other croak functions are.
|