| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
| |
In the API, rename the 'screamer' arg to be 'sv' instead;
update the description of the functions args;
improve the documentation of the REXEC_* flags for the 'flags' arg.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
PL_hints stores the hints at compile time that get copied into the
cop_hints field of each COP (in newSTATEOP).
Since perl-5.8.0-8053-gd5ec298, COPs have stored all the hints.
Before that, COPs used to store only some of the hints. The hints
were copied here and there into PL_compiling, a static COP-shaped buf-
fer used during compilation, so that things like constant folding
would see the correct hints. a0ed51b3 back in 1998 did that.
Now that COPs can store all the hints, we can just use
PL_compiling.cop_hints to avoid having to copy them from PL_hints from
time to time.
This simplifies the code and avoids creating bugs like those that
a547fd219 and 1c75beb82 fixed.
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
This reverts commit 2e0b8fbeab3502bee36f25825c3cdd0d075c4fd3, which
reverted e0ce103ae532f9576f54a5938a24d1ee98dfb928, thus reinstating the
latter commit. It turns out that the error being chased down was not
due to this commit.
Its original message was:
This converts inversion lists to use their own scalar type.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This reverts commit 49cf1d6641a6dfd301302f616e4f25595dcc65d4, which
reverted e045dbedc7da04e20cc8cfccec8a2e3ccc62cc8b, thus reinstating the
latter commit. It turns out that the error being chased down was not
due to this commit.
Its original message was:
This reshuffles the svtype enum to remove the dummy slot created in a
previous commit, and add the new SVt_INVLIST type in its proper order.
It still is unused, but since it is an extension of SVt_PV, it must be
greater than that type's enum value. Since it can't be upgraded to any
other PV type, it comes right after SVt_PV.
Affected tables in the core are updated.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This commit causes the locale initialization to skip calling
setlocal(foo, "") if the environment variable PERL_SKIP_LOCALE_INIT is
set. Instead, the setup code calls setlocale(LC_ALL, NULL) (plus other
similar calls for the subcategories) in order to find out what the
current locale is.
The original poster for this ticket has a workaround for it which
involves using a modified copy of Perl core code. This patch defines
the C preprocessor variable HAS_SKIP_LOCALE_INIT that can be used by XS
writers to discover if the current Perl version needs the workaround or
not.
I was unable to come up with a test for this patch that did not involve
building extensive infrastructure for testing embedded Perl. That does
not seem worth it for such a trivial patch. I tested by hand.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
In reality, the return value of setlocale() is documented to be opaque,
so using it to determine if a locale is UTF-8 or not may not work. It
is a char*, which we treat as a name. We can safely assume that if the
name contains UTF-8 (or slight variations thereof), that it is a UTF-8
locale. But if the name doesn't contain that, it still could be one.
In fact there are currently many locales on our dromedary machine that
fall into this category. Similarly, something containing 8859 is not
going to be UTF-8.
This commit adds another test for cases where there is no nl_langinfo(),
and the locale name isn't helpful. It looks at the currency symbol,
which typically will be in the locale's script. If that is illegal
UTF-8, we know for sure that the locale isn't UTF-8 (or is corrupted).
If it is legal UTF-8 (but not ASCII) we can be pretty sure that the
locale is UTF-8. If it is ASCII, we still don't know one way or the
other, so we err on it not being UTF-8.
Originally, I was going to use the locale's error message strings,
returned from strerror(), the source for $!, to check for this.
These are supposed to be in terms of the LC_MESSAGES locale. Chances
are vanishingly small that the locale is not UTF-8 if all the messages
pass a utf8ness test, provided that the messages aren't just ASCII.
However, on dromedary, the messages for many of the exotic locales
haven't been translated, and are still in English, which doesn't help at
all. I figure that this is quite likely to be the case generally, and
the currency symbol is much more likely to have been translated.
I left the code in though, commented out for possible future use.
Note that this test will run only on systems that don't have
nl_langinfo(). The test can also be turned off by setting a C compiler
flag -DNO_LOCALE_MONETARY, (and -DNO_LOCALE_MESSAGES for the
commented-out part), corresponding to the way the other categories can
be turned off (none of which is documented).
|
|
|
|
| |
This indents some nested #if's to clarify the program structure.
|
|
|
|
|
|
|
|
| |
This reverts commit e045dbedc7da04e20cc8cfccec8a2e3ccc62cc8b.
Blead won't compile with address sanitizer; commit
7cb47964955167736b2923b008cc8023a9b035e8 reverting an earlier commit
failed to fix that. I'm trying two more reversions to get it back
working. This is one of those
|
|
|
|
|
|
| |
This reverts commit e0ce103ae532f9576f54a5938a24d1ee98dfb928.
This commit is failing compilations with address sanitizer, and we don't
know why. This reverts it while we work that out.
|
|
|
|
| |
This converts inversion lists to use their own scalar type.
|
|
|
|
|
|
|
|
|
|
| |
This reshuffles the svtype enum to remove the dummy slot created in a
previous commit, and add the new SVt_INVLIST type in its proper order.
It still is unused, but since it is an extension of SVt_PV, it must be
greater than that type's enum value. Since it can't be upgraded to any
other PV type, it comes right after SVt_PV.
Affected tables in the core are updated.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This format string allows char*s to be interpolated with the
utf8ness and length specified as well, avoiding the need to create
extra SVs:
Perl_croak(aTHX_ "Couldn't twiggle the twoggle in \"%"UTF8f"\"",
UTF8fARG(is_utf8, len, s));
This is the second attempt.
I screwed up in commits 1c8b67b38f0a5 and b3e714770ee1 because
I didn’t really understand how varargs functions receive their
arguments.
They are like structs, in that different members can be different
sizes. So therefore both ends--the caller and the called--*must* get
the casts right, or the data will be corrupted.
The main mistake I made was to use %u in the format for the first
argument and then retrieve it as UV (a simple typo, I meant unsigned
int or U32--I don’t remember).
To be on the safe side, I added a UTF8fARG macro (after SVfARG), which
(unlike SVfARG) takes three arguments and casts them explicitly, mak-
ing it much harder to get this wrong at call sites.
|
|
|
|
|
|
|
|
| |
This reverts commit 670610ebb17508101065cc5f5ecfe616aace5335.
This and the other UTF8f patch are causing significant problems on some
configurations on 32-bit platforms. We've decided to revert them until
they can be resubmitted after the kinks get ironed out.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This new format string allows char*s to be interpolated with the
utf8ness and length specified as well:
Perl_croak(aTHX_ "Couldn't twiggle the twoggle in \"%"UTF8f"\"",
is_utf8, len, s);
This commit changes one function call in gv.c to use UTF8f (it should
go faster now) as an example of its use.
This was brought up in ticket #113824. This commit does not fix
#113824, but provides groundwork that makes it easier to fix.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
(note that this is a change both to the perl API and the regex engine
plugin API).
Currently, Perl_re_intuit_start() is passed an SV, plus pointers to:
where in the string to start matching (strpos); and to the end of the
string (strend).
Unlike Perl_regexec_flags(), it doesn't also have a strbeg arg.
Because of this this, it guesses strbeg: based on the passed SV (if its
svPOK()); or just set to strpos otherwise. This latter can happen if for
example the SV is overloaded. Note also that this latter guess is wrong,
and could in theory make /\b.../ fail.
But just to confuse matters, although Perl_re_intuit_start() itself uses
its guesstimate strbeg var, some of the functions it calls use the global
value of PL_bostr instead. To make this work, the *callers* of
Perl_re_intuit_start() currently set PL_bostr first. This is why \b
doesn't actually break.
The fix to this unholy mess is to simply add a strbeg arg to
Perl_re_intuit_start(). It's also the first step to eliminating PL_bostr
altogether.
|
|
|
|
|
| |
DG/UX was a Unix sold by Data General. The last release was in April 2001.
It only runs on Data General's own hardware.
|
|
|
|
|
|
| |
I didn't realise that the perl -V list of defines is now split between
perl.h and perl.c and so added it to one (thinking it was missing) when it
was already in the other).
|
|
|
|
|
|
|
|
|
|
|
|
| |
COW was first introduced (and enabled by default) in 5.17.7.
It was disabled by default in 5.17.10, because it was though to have too
many rough edges for the 5.18.0 release.
By re-enabling it now, early in the 5.19.x release cycle, hopefully it
will be ready for production use by 5.20.
This commit mainly reverts 9f351b45f4 and e1fd41328c (with modifications),
then updates perldelta.
|
|
|
|
|
|
|
|
|
|
| |
fakethr.h and FAKE_THREADS were for a "green" threads implementation of
5005threads. 5005threads itself is long gone, and it's not clear that
-DFAKE_THREADS *ever* built correctly. Certainly it did not work for the
5.005 release, and it did not work at the time of the commits for the initial
checkin. The closest that it seems to have been to working is around commit
c6ee37c52f2ca9e5 (Dec 1997), where the headers no longer contained errors,
but perl.c failed to compile.
|
|
|
|
|
|
| |
As pp_pack.c has had mixed-endian support removed, there is little point in
keeping code in perl.h and util.c only needed for architectures that cannot
be built.
|
|
|
|
|
| |
This removes the only users of my_{be,le,h}to{be,le,h}n, so remove the
definitions for those macros.
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
These are now only being used for mixed-endian platforms which do not
provide their own htnol (etc) functions. Given that the fallbacks have been
buggy since they were added in Perl 3.0, it's safe to conclude that no
mixed-endian platforms were ever using these functions.
It's also unclear why these functions were ever marked as 'A', part of the
API. XS code can't call them directly, as it can't rely on them being
compiled. Unsurprisingly, no code on CPAN references them.
|
|
|
|
|
| |
The host byteorder agnostic functions in util.c are now only used on mixed
endian systems.
|
|
|
|
|
|
|
|
|
|
|
| |
This means that there are always macros or functions for ntohl, ntohs,
htonl and htons available, so eliminate use of HAS_NTOHL etc, and
unconditionally compile the code that it was protecting. However, as code
on CPAN is using these guard macros, define all of them in perl.h
(Technically the 4 are not quite no-ops, as they truncate their values to
32 or 16 bits, to be consistent with the implementations for platforms which
need re-ordering.)
|
|
|
|
|
|
|
|
|
|
|
| |
This means that there are always macros or functions for vtohl, vtohs,
htovl and htovs available, so eliminate HAS_VTOHL etc, and unconditionally
compile the code that it was protecting. grep.cpan.me shows that no code on
CPAN uses any of these macros.
(Technically the 4 are not quite no-ops, as they truncate their values to
32 or 16 bits, to be consistent with the implementations for platforms which
need re-ordering.)
|
|
|
|
|
|
|
| |
Previously they were implemented as function calls on 64 bit little endian
systems. Bit endian systems implemented them as byte-swapping macros. 32
little endian system didn't implement them at all. 32 and 64 bit little
endian systems now behave identically.
|
|
|
|
|
|
|
|
|
|
|
| |
This avoids problems such as pointers being compared with the literal value 1.
Suggested by Zefram.
Note that this is technically a change of behaviour, as the macro EXPECT(),
which they are both both wrappers for, returns its value, so they will now
be returning TRUE or FALSE, rather than the actual value passed to them.
However, all uses in the core and on CPAN are only within if() statements, so
this should not make any difference in practice.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This permits test code to include the perl headers for definitions without
creating a link dependency on the perl library (which may not exist yet).
Some of the static inline functions in inline.h reference functions in the
perl object files, and some compilers aren't smart enough to eliminate
unused static inline functions, hence including the inline.h in probe code
can cause link errors even though the probe code uses none of the functions
it declares. When probing, a failed link is taken as meaning that the
probed-for function is not present, as the assumption is that the link fails
because of it. Hence other causes of link failures cause the probing code to
generate incorrect results, and action (and bugs) at a distance.
|
|
|
|
|
|
|
|
| |
This adds branch prediction hints to a few strategic places such as
growing stack or strings, some exception handling, and a few hot
functions such as sv_upgrade.
This is not exhaustive by any means.
|
|
|
|
|
|
|
|
| |
It was felt that the new COW feature wasn't ready to be enabled be default
in 5.18: principally because too much XS code will assume it can just
manipulate the PVX buffer of an SVf_POK SV.
See RT #116569 for the discussion.
|
|
|
|
|
| |
This patch was posted in
http://markmail.org/message/pwjxbxnlazvxgsyw
|
| |
|
|
|
|
|
|
|
|
|
| |
BeOS was an operating system for personal computers developed by Be Inc,
initially for their BeBox hardware. The OS Haiku was written as an open source
replacement/continuation for BeOS, and its perl port is current and actively
maintained.
The BeOS port has not been updated since 2004.
|
|
|
|
|
| |
'len' arg to my_vsnprintf() is supposed to be Size_t; cast it that way
before testing it.
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
PL_sawampersand actually causes bugs (e.g., perl #4289), because the
behaviour changes. eval '$&' after a match will produce different
results depending on whether $& was seen before the match.
Using copy-on-write for the pre-match copy (preceding patches do that)
alleviates the slowdown caused by mentioning $&. The copy doesn’t
happen unless the string is modified after the match. It’s now a
post- match copy. So we no longer need to do things differently
depending on whether $& has been seen.
PL_sawampersand is now #defined to be equal to what it would be if
every program began with $',$&,$`.
I left the PL_sawampersand code in place, in case this commit proves
immature. Running Configure with -Accflags=PERL_SAWAMPERSAND will
reënable the PL_sawampersand mechanism.
|
|
|
|
|
|
|
|
| |
One can disable this with -Accflags=-DPERL_NO_COW.
I am leaving this in for debugging purposes. If it causes no problems
in 5.18, we might remove the defines and enable it unconditionally in
5.20, but then again we might not.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This was discussed in ticket #114820.
This new copy-on-write mechanism stores a reference count for the
PV inside the PV itself, at the very end. (I was using SvEND+1
at first, but parts of the regexp engine expect to be able to do
SvCUR_set(sv,0), which causes the wrong byte of the string to be used
as the reference count.) Only 256 SVs can share the same PV this way.
Also, only strings with allocated space after the trailing null can
be used for copy-on-write.
Much of the code is shared with PERL_OLD_COPY_ON_WRITE. The restric-
tion against doing copy-on-write with magical variables has hence been
inherited, though it is not necessary. A future commit will take
care of that.
I had to modify _core_swash_init to handle $@ differently. The exist-
ing mechanism of copying $@ to a new scalar and back again was very
fragile. With copy-on-write, $@ =~ s/// can cause pp_subst’s string
pointers to become stale. So now we remove the scalar from *@ and
allow the utf8-table-loading code to autovivify a new one. Then we
restore the untouched $@ afterwards if all goes well.
|
|
|
|
|
|
|
| |
This finishes the removal of register declarations started by
eb578fdb5569b91c28466a4d1939e381ff6ceaf4. It neglected the ones in
function parameter declarations, and didn't include things in dist, ext,
and lib, which this does include
|
|
|
|
|
|
|
| |
EPOC was a family of operating systems developed by Psion for mobile
devices. It was the predecessor of Symbian.
The port was last updated in April 2002.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
DESTROY has been cached in overload tables since
perl-5.6.0-2080-g32251b2, making it 4 times faster than before (over-
load tables are faster than method lookup).
But it slows down symbol lookup on stashes with overload tables,
because overload tables use magic, and SvRMAGICAL results in calls to
mg_find on every hash lookup.
By reusing SvSTASH(stash) to cache the DESTROY method (if the stash
is unblessed, of course, as most stashes are), we can avoid making
all destroyable stashes magical and also speed up DESTROY lookup
slightly more.
The results:
• 10% increase in stash lookup speed after destructors. That was just
testing $Foo::{x}. Other stash lookups will have other overheads
that make the difference less impressive.
• 5% increase in DESTROY lookup speed. I was using an empty DESTROY
method to test this, so, again, real DESTROY methods will have more
overhead and less speedup.
|
|
|
|
|
|
|
|
|
| |
This commit eliminates a couple strlen()s of a literal. "Out of memory!\n"
and PL_no_mem did not string pool on Visual C, so PL_no_mem was given a
length. This commit removes S_write_no_mem and replaces it with nonstatic.
Perl_croak_no_mem was made nocontext to save instructions in it's callers.
NORETURN_FUNCTION_END caused a syntax error on Visual C C++ mode and
therefore was removed.
|
|
|
|
|
|
|
|
|
| |
dTHXes that were unused, or because Newx/Safefree were the only things
called were removed. In some places the dTHX turned into dTHXa and aTHXa
so the context is not fetched until it is actually used
(locality/frees a C stack slot or frees a non-volatile register). Also see
http://www.nntp.perl.org/group/perl.perl5.porters/2012/10/msg194414.html
and http://www.nntp.perl.org/group/perl.perl5.porters/2012/10/msg194861.html
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
I failed to update the commit message of the previous commit (sorry!).
The code is in a much better shape than the message claims and Configure
support, for example, won't be added at all to require more
determination from users. PL_taint_warn has since received the same
treatment. To wit:
# define TAINT_WARN_get (PL_taint_warn)
# define TAINT_WARN_set(s) (PL_taint_warn = (s))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
By defining NO_TAINT_SUPPORT, all the various checks that perl does for
tainting become no-ops. It's not an entirely complete change: it doesn't
attempt to remove the taint-related interpreter variables, but instead
virtually eliminates access to it.
Why, you ask? Because it appears to speed up perl's run-time
significantly by avoiding various "are we running under taint" checks
and the like.
This change is not in a state to go into blead yet. The actual way I
implemented it might raise some (valid) objections. Basically, I
replaced all uses of the global taint variables (but not PL_taint_warn!)
with an extra layer of get/set macros (TAINT_get/TAINTING_get).
Furthermore, the change is not complete:
- PL_taint_warn would likely deserve the same treatment.
- Obviously, tests fail. We have tests for -t/-T
- Right now, I added a Perl warn() on startup when -t/-T are detected
but the perl was not compiled support it. It might be argued that it
should be silently ignored! Needs some thinking.
- Code quality concerns - needs review.
- Configure support required.
- Needs thinking: How does this tie in with CPAN XS modules that use
PL_taint and friends? It's easy to backport the new macros via PPPort,
but that doesn't magically change all code out there. Might be
harmless, though, because whenever you're running under
NO_TAINT_SUPPORT, any check of PL_taint/etc is going to come up false.
Thus, the only CPAN code that SHOULD be adversely affected is code
that changes taint state.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Since the xpvlv and regexp structs conflict, we have to find somewhere
else to put the regexp struct.
I was going to sneak it in SvPVX, allocating a buffer large
enough to fit the regexp struct followed by the string, and have
SvPVX - sizeof(regexp) point to the struct. But that would make all
regexp flag-checking macros fatter, and those are used in hot code.
So I came up with another method. Regexp stringification is not
speed-critical. So we can move the regexp stringification out of
re->sv_u and put it in the regexp struct. Then the regexp struct
itself can be pointed to by re->sv_u. So SVt_REGEXPs will have
re->sv_any and re->sv_u pointing to the same spot. PVLVs can then
have sv->sv_any point to the xpvlv body as usual, but have sv->sv_u
point to a regexp struct. All regexp member access can go through
sv_u instead of sv_any, which will be no slower than before.
Regular expressions will no longer be SvPOK, so we give sv_2pv spec-
ial logic for regexps. We don’t need to make the regexp struct
larger, as SvLEN is currently always 0 iff mother_re is set. So we
can replace the SvLEN field with the pv.
SvFAKE is never used without SvPOK or SvSCREAM also set. So we can
use that to identify regexps.
|