| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Adds syntax `defer { BLOCK }` to create a deferred block; code that is
deferred until the scope exits. This syntax is guarded by
use feature 'defer';
Adds a new opcode, `OP_PUSHDEFER`, which is a LOGOP whose `op_other` field
gives the start of an optree to be deferred until scope exit. That op
pointer will be stored on the save stack and invoked as part of scope
unwind.
Included is support for `B::Deparse` to deparse the optree back into
syntax.
|
|
|
|
|
|
|
|
|
|
|
| |
This header was originally only needed for builds on darwin and
FreeBSD, but was being included whenever it was detected.
This has caused problems when what was an internal header was
removed (from glibc) and in general wasn't needed anyway.
On FreeBSD only localeconv_l() requires xlocale.h, so we test
specifically for that.
|
|
|
|
|
|
| |
Remove the code in Perl_ck_sort() that reads from PL_hintgv that sets these,
and the code in pp_sort that reads them and sets SORTf_STABLE and
SORTf_UNSTABLE (which were no longer read. Remove these too.)
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This will prove useful in future commits on platforms that have 64 bit
capability.
The deBruijn sequence used here, taken from the internet, differs
from the 32 bit one in how they treat a word with no set bits. But this
is considered undefined behavior, so that difference is immaterial.
Apparently figuring this out uses brute force methods, and so I decided
to live with this difference, rather than to expend the time needed to
bring them into sync.
|
|
|
|
|
|
| |
This moves the code from regcomp.c to inline.h that calculates the
position of the lone set bit in a U32. This is in preparation for use
by other call sites.
|
|
|
|
|
|
| |
This saves typing and potential mistakes
The idea and implementation are from Tomasz Konojacki
|
| |
|
|
|
|
|
|
|
|
|
|
| |
This warns (and warns a lot) on clang, and since these are documented
to only work to make a single statement, so there's little value to
allowing them to work in an expression.
An alternative would be to disable GCC brace groups on clang, but
these are used extensively in DEBUGGING builds to add extra checks
in sv.h.
|
|
|
|
|
|
|
| |
Different types for a variable across compilation units can in
theory cause undefined behavior. In this case I think it's unlikely
to cause an issue, but LTO builds also (correctly) complain about
the type mismatch, so ensure they match.
|
| |
|
| |
|
|
|
|
|
|
| |
Commit 5d5b9c460e2a06563d2b5e35a1a79991460696eb fixed the definition of
ASSUME for some purposes, but broke it on Windows. This commit should
fix that.
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
| |
This is a rebasing by @khw of part of GH #18792, which I needed to get
in now to proceed with other commits.
It also strips trailing white space from the affected files.
|
| |
|
|
|
|
|
|
|
|
|
|
| |
This commit adds two macros that a user can define and recompile Perl to
get every active DEBUG statement to do some thing beyond what it would
normally do.
This allows someone to recompile Perl when they need to delve deeper
into fixing a bug without otherwise increasing memory use or slowing
execution.
|
|
|
|
|
|
| |
I wrote this years ago, and now have discovered it was written
assuming the consumer is more familiar with the underlying code than
warranted.
|
|
|
|
|
|
|
| |
There are some debugging statements that should only be displayed when
two flags are set; so far the v flag and another. This commit creates
a macro for that purpose that saves a conditional (at least when
unoptimized) over the previous way to do it.
|
| |
|
|
|
|
| |
Align __float128 when using 64-bit mingw compilers.
|
|
|
|
|
|
|
| |
We have tests to make sure this doesn't go negative, but wrongly
declared the variable as unsigned.
Spotted by Craig Berry.
|
|
|
|
|
|
|
|
| |
get_env() needs to lock other threads from writing to the environment
while it is executing. It may need to have an exclusive lock if those
threads can clobber its buffer before it gets a chance to save them.
The previous commit has added a Configure probe which tells us if that
is the case. This commit uses it to select which type of mutex to use.
|
|
|
|
|
|
|
|
| |
There are several places where there could be a problem in the
environment were changed by another thread when a function is executing,
but otherwise if another thread were reading the environment at the same
time, there isn't a problem. This adds mutex for that situation.
Future commits will take advantage of it.
|
|
|
|
| |
Properly indent some nested #defines
|
|
|
|
|
| |
The old name did not encompass all the possible reasons for the
mutex signal condition to be invoked
|
|
|
|
|
|
|
| |
These have an inconsistent configuration in which several functions exist
for thread-safe locales, but the crucial one doesn't show up in our
Configure probe. The code this commit fixes assumed that all or nothing
would be present.
|
|
|
|
|
|
|
|
|
| |
These locks for different functions all use the same underlying mutex;
but that may not always be the case. By creating separate names
used only when we think they will be necessary, the compiler will
complain if the conditions in the code that actually use them are the
same. Doing this showed a misspelling in an #ifdef, fixed in
9289d4dc7a3d24b20c6e25045e687321ee3e8faf
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This was prompted by my realization that even on a locale thread-safe
platform, there are functions we call that may not be thread-safe in
that they return their results in an internal static buffer, which may
be process-wide instead of per-thread. Tomasz Konojacki++ briefly
looked at Windows source code for localeconv() and this indeed did
appear to be the case.
If we thought a platform was thread-safe, no locale mutexes were set up,
and instead the calls in the code to lock were no-oops. This would lead
to potential races, the most likely candidate being localeconv(). None
have been reported, at least as far as we know. Likely that function
isn't called frequently. This would be true on both Posix 2008 and
Windows platforms, except possibly for FreeBSD, which may be the only
platform that we support that has a localeconv_l() function, which is
supposed to be immune from this issue..
The solution adopted here is to test for all the possible functions that
the Perl core uses that may be susceptible to this, and to set up the
mutex if any are found. Thus there won't be no-ops where there should
be a lock.
|
|
|
|
|
| |
This macro is for localeconv(); the new name is clearer as to the
meaning, and this preps for further changes.
|
|
|
|
| |
This previously worked on some compilers, but not others.
|
|
|
|
|
|
|
|
|
|
|
|
| |
Commit e7ae132ec78 consolidated PERL_SMALL_MACRO_BUFFER usages, but it
omitted the _MSC_VER number at which the buffer became large enough.
Apparently it did this because Windows compilations were failing with
the error "string too long", which doesn't happen if __ASSERT_ expands
to nothing, which it does under PERL_SMALL_MACRO_BUFFER.
However, commits 92a0bb2 and 88086fd shortened the offending strings
so later Windows compilers don't have to be considered as having small
macro buffers.
|
|
|
|
|
| |
This is in preparation for future commits where things will be needed
earlier/later than currently.
|
| |
|
|
|
|
| |
These are useless here
|
|
|
|
|
|
| |
The mutex macros already in perl are sufficient to allow us to emulate
this type of locking, which may also be available natively, but I don't
think it is worth the effort to use the native calls.
|
| |
|
| |
|
|
|
|
| |
or at least lead people to use something better
|
| |
|
|
|
|
|
| |
As the comment said, this was temporary until vtables got to be all
const
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This commit provide some basic method
to access to internal fields from one
INVLIST: SVt_INVLIST
- prev_index
- is_offset
- array_len
- get_invlist_array
This allows B::C to be walk and save invlists.
|
|
|
|
|
|
|
| |
This fixes GH #18295
The #ifdef introduced in 6bcc290 was meant to go after the line that it
actually did
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
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 #ifdef'd code clearly doesn't get compiled, as it would fail.
|
| |
|