| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
| |
5.32 did this for one form; now all do.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
These were occurring on FreeBSD smokes.
warning: implicit conversion from 'IV' (aka 'long') to 'double' changes value from 9223372036854775807 to 9223372036854775808 [-Wimplicit-int-float-conversion]
9223372036854775807 is IV_MAX. What needed to be done here was to use
the NV containing IV_MAX+1, a value that already exists in perl.h
In other instances, simply casting to an NV before doing the comparison
with the NV was what was needed.
This fixes #18328
|
|
|
|
|
|
| |
This function is called only at compile time; experience has shown that
compile-time operations are not time-critical. And future commits will
lengthen it, making it not practically inlinable anyway.
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
| |
|
|
|
|
|
| |
This uses a new organization of sections that I came up with. I asked
for comments on p5p, but there were none.
|
|
|
|
|
| |
apidoc_section is slightly favored over head1, as it is known only to
autodoc, and can't be confused with real pod.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This inline function was added by v5.31.0-27-g3a019afd6f to consolidate
similar code in several places, like pp_add(). It also avoided undefined
behaviour, as seen by ASan, by no longer unconditionally trying to cast
an NV to IV - ASan would complain when nv was -Inf for example.
However that commit introduced a performance regression into common
numeric operators like pp_and(). This commit partially claws back
performance by skipping the initial test of 'skip if Nan' which called
Perl_isnan(). Instead, except on systems where NAN_COMPARE_BROKEN is
true, it relies on NaN being compared to anything always being false,
and simply rearranges existing conditions nv < IV_MIN etc to be
nv >= IV_MIN so that any NaN comparison will trigger a false return.
This claws back about half the performance loss. The rest seems
unavoidable, since the two range tests for IV_MIN..IV_MAX are an
unavoidable part of avoiding undefined behaviour.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
GH #18081
A sub call via return in a sort block was called in void rather than
scalar context, causing the comparison result to be discarded.
This because when a sort block is called it is not a real function
call, even though a sort block can be returned from. Instead, a
CXt_NULL is pushed on the context stack. Because this isn't a sub-ish
context type (unlike CXt_SUB, CXt_EVAL etc) there is no 'caller sub'
on the context stack to be found to retrieve the caller's context
(i.e. cx->cx_gimme).
This commit fixes it by special-casing Perl_gimme_V().
Ideally at some future point, a new context type, CXt_SORT, should be
added. This would be used instead of CXt_NULL when a sort BLOCK is
called. Like other sub-ish context types, it would have an old_cxsubix
field and PL_curstackinfo->si_cxsubix would point to it. This would
eliminate needing special-case handling in places like Perl_gimme_V().
|
|
|
|
|
|
|
|
|
| |
This returns the number of elements in an array in a clearly named
function.
av_top_index(), av_tindex() are clearly named, but are less than ideal,
and came about because no one back then thought of this one, until now
Paul Evans did.
|
|
|
|
|
| |
It only does anything under PERL_GLOBAL_STRUCT, which is gone.
Keep the dNOOP defintion for CPAN back-compat
|
|
|
|
|
| |
Mostly in comments and docs, but some in diagnostic messages and one
case of 'or die die'.
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The previous commit added a mutex specifically for protecting against
simultaneous accesses of the environment. This commit changes the
normal getenv, putenv, and clearenv functions to use it, to avoid races.
This makes the code simpler in places where we've gotten burned and
added stuff to avoid races. Other places where we haven't known we were
getting burned could have existed until now. Now that comes
automatically, and we can remove the special cases we earlier stumbled
over.
getenv() returns a pointer to static memory, which can be overwritten at
any moment from another thread, or even another getenv from the same
thread. This commit changes the accesses to be under control of a
mutex, and in the case of getenv, a mortalized copy is created so that
there is no possible race.
|
| |
|
| |
|
| |
|
|
|
|
| |
This internal function is more properly bool, not I32.
|
|
|
|
|
| |
The remaining function in this file is moved to inline.h, just to not
have an extra file lying around with hardly anything in it.
|
|
|
|
|
|
|
| |
This commit changes this function to use memchr() instead of looping
byte-by-byte through the string. And it inlines it into 3 lines of
code. This should give comparable performance to a native libc
strnlen().
|
|
|
|
|
| |
Remove MS Visual C++ 6.0 support as agreed in the thread starting here:
https://www.nntp.perl.org/group/perl.perl5.porters/2019/07/msg255625.html
|
|
|
|
|
|
| |
This commit moves more URLs from http to https. This time it
affects some source code, that's why it is not bunched up
with the commits affecting pod/*
|
|
|
|
|
|
|
|
| |
original merge commit: v5.31.3-198-gd2cd363728
reverted by: v5.31.4-0-g20ef288c53
The commit following this commit fixes the breakage, which that means
the revert can be undone.
|
|
|
|
|
|
|
|
|
|
|
|
| |
This reverts commit d2cd363728088adada85312725ac9d96c29659be, reversing
changes made to 068b48acd4bdf9e7c69b87f4ba838bdff035053c.
This change breaks installing Test::Deep:
...
not ok 37 - Test 'isa eq' completed
ok 38 - Test 'isa eq' no premature diagnostication
...
|
|
|
|
|
| |
So we don't need to check whether (cxstack[cxix].blk_gimme & G_WANT),
just use it. Replace the check with an assertion.
|
|
|
|
|
|
| |
This function makes use of PL_curstackinfo->si_cxsubix to avoid the
overhead of a call to block_gimme() when the context of the op is
unknown.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This tracks the most recent sub/eval/format context pushed onto the
context stack. Then make dopopto_cursub use it.
The previous value is saved in the cxt struct, and is restored whenever
the context is popped.
This adds a tiny overhead for every sub call, but speeds up other
operations, such as determining the caller context when returning a
value from a sub - this has to be dpne for every sub call where the last
expression is context sensitive, so its often a win.
|
|
|
|
| |
Two parameters weren't described, nor the warnings category used.
|
|
|
|
|
| |
This is because it has the X flag, which means the function is visible
on ELF systems.
|
|
|
|
| |
This inline function should have an entry.
|
|
|
|
| |
These function names need a Perl_ prefix to avoid namespace pollution.
|
|
|
|
|
|
| |
and change the name of one. CvDEPTH shouldn't have a trailing 'p' to
indicate private memeber access. It may do so internally, but the name
shouldn't indicate that.
|
|
|
|
|
| |
This inline function should not be visible outside certain core (and
ext/re) functions. Make that happen.
|
|
|
|
|
|
| |
Traditionally, functions in perl have been written so their initial '{'
is in column 1 after the prototype. This makes grepping easier. This
commit brings 3 functions in this file into conformance.
|
|
|
|
| |
All functions should have a prefix.
|
|
|
|
| |
but are inline functions. They should be listed in embed.fnc.
|
|
|
|
| |
Names with leading underscores are reserved for the C implementers.
|
|
|
|
|
| |
A function name with a leading underscore is not legal in C. Instead
add a suffix to differentiate this name from an otherwise identical one.
|
|
|
|
| |
Leading underscored name are reserved for the C implementers
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This is being done only for those functions that don't have a guard
preventing them from being seen outside of the Perl core.
Talking to Tony Cook, we agreed that this was a good idea for two
reasons:
1) The 'Perl_' prefix does not pollute XS caller's name space. The 'S_'
one could be argued that it doesn't much either, but it does more so
than 'Perl_', and the next reason is the clincher:
2) It allows us to change our minds about whether a function should be
static inline or not, without affecting callers who use the Perl_
form, which they would be accustomed to anyway if they're using the
full name form.
|
|
|
|
|
|
|
| |
The previous commit added the C flag, which is better to use in many
instances than x. This commit changes the x entries in embed.fnc that
I'm pretty sure would be better off being C, and removes some 'x'
entries for internal only functions
|
|
|
|
|
|
|
|
| |
The final step was missing in the conversion from UTF-EBCDIC to uv.
This adds a macro call that expands to its argument on non-EBCDIC
platforms, so this commit makes no changes to the compiled binary on
those systems.
|
|
|
|
|
|
|
|
|
|
| |
It did so already except when passed a zero length input on
non-debugging builds. This caused test failures in Devel::PPPort, and
commit 4a5ab54a18679ab24ca03190884d326c2ca85288 was used to customize
that module in blead to get the tests to pass.
This commit avoids the possibility of having to bump the version again,
which is what that commit did.
|
|
|
|
|
|
|
|
|
|
|
| |
For well formed input, there is no change. But for malformed it wasn't
returning the documented length when warnings were enabled, and not
always the documented value when they were disabled.
This is implemented as an inline function, called from both the macro
and the Perl_ form.
Devel::PPPort has sufficient tests for this.
|
|
|
|
|
|
|
|
|
| |
This information is already in embed.fnc, and we know it compiles. Some
of this information is now out-of-date. Get rid of it.
There was one bit of information that was (apparently) wrong in
embed.fnc. The apidoc line asked that there be no usage example
generated for newXS. I added that flag to the embed.fnc entry.
|
|
|
|
|
|
|
|
| |
Essentially the same code was being used in three places, and had
undefined C behavior for some inputs.
This consolidates the code into one inline function, and rewrites it to
avoid undefined behavior.
|
| |
|
|
|
|
|
| |
This function works as well as possible on non-UTF-8 inputs. No need to
list the UTF-8-only failures, since those aren't legal inputs.
|
| |
|