| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
| |
These were for when some of the Posix character classes were implemented
as swashes, which is no longer the case, so these can be removed.
|
|
|
|
| |
This is now obsolete as a result of the last few commits.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
MSVC due to a bug doesn't merge identicals between .o'es or discard these
vars and their contents.
MEM_WRAP_CHECK_2 has never been used outside of core according to cpan grep
MEM_WRAP_CHECK_2 was removed on the "have PERL_MALLOC_WRAP" branch in
commit fabdb6c0879 "pre-likely cleanup" without explination, probably bc
it was unused. But MEM_WRAP_CHECK_2 was still left on the "no
PERL_MALLOC_WRAP" branch, so remove it from the "no" side for tidyness
since it was a mistake to leave it there if it was removed from the "yes"
side of the #ifdef.
Add MEM_WRAP_CHECK_s API, letter "s" means argument is string or static.
This lets us get rid of the "%s" argument passed to Perl_croak_nocontext at
a couple call sites since we fully control the next and only argument and
its guaranteed to be a string literal. This allows merging of 2
"Out of memory during array extend" c strings by linker now.
Also change the 2 op.h messages into macros which become string literals
at their call sites instead of "read char * from a global char **" which
was going on before.
VC 2003 32b perl527.dll section size before
.text name
DE503 virtual size
.rdata name
4B621 virtual size
after
.text name
DE503 virtual size
.rdata name
4B5D1 virtual size
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Due to some MSVC bug or perl's not using MS specific CC options that I've
never figured out, MSVC does not remove unreferenced by a single .obj or
combine identical, static const data vars. MSVC funcs get removed &
combined correctly. Since for var swash_property_names removing it from
.objs that dont need it is very easy, do it. It saves some memory space.
Perhaps some other platforms/OSes/CCs have similar problems removing
unreferenced symbols from final binaries so this patch would help on those
CCs too.
regexec.c stopped using swash_property_names in commit 2a16ac9277 in 5.19.8
"regexec.c: Use compiled-in POSIX definitions"
regcomp.c stopped using swash_property_names in commit bcb875216f in 5.19.8
"regcomp.c: Rmv code for delayed 'til runtime POSIX defns"
with MSVC 2008 64, before
miniperl.exe disk file size 1761KB .rdata virtual size 0xBC354 bytes
perl527.dll disk file size 2040KB .rdata virtual size 0xC9421 bytes
after this commit
miniperl.exe disk file size 1761KB .rdata virtual size 0xBC2C4 bytes
perl527.dll disk file size 2040KB .rdata virtual size 0xC9381 bytes
~144 bytes saved by removing unused copies of swash_property_names array.
There are other cases of large duplicate static const data vars still in
the perl527.dll binary but this patch covers a very simple case.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
These are useful if you know you have a variable with a restricted range,
and so could fit in a byte or 16 bits, but speed is more important.
These C99 typedefs allows you to specify the minimal size you need, and
allows the compiler to substitute a wider type if it is faster.
This commit adds typedefs spelled the same as the C99 ones, but upper
cased. On non-C99 compilers, it just uses 'int' behind the scenes,
which should be safe.
These are currently restricted to core to be sure these aren't a bad
idea before they are made public.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
On systems that don't have them, this emulates
U?INT(16|32)_C
U?INTMAX_C
and the typedefs
u?intmax_t
Since, these are typedefs that can't be tested for if they exist, this
creates PERL_U?INTMAX_T typedefs instead, setting them to the standard
values in stdint.h if it is available.
In addition, it moves the pre-existing emulation of U?INT64_C from
handy.h to perl.h. This is because there was duplicate-ish logic in the
two files, and the handy.h version appears to be better thought out.
It converts the couple of places in core that were using the other
deleted logic to instead use the C99 names.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Because HAS_QUAD is not defined outside the perl core, this macro was
not getting defined properly for 64-bit systems. This means, for
example, that someone using this to cast could end up with the wrong
answer. For example isASCII(2**32) would yield true, because the high
bit would get dropped by the cast, making the value appear to be zero.
This unfortunately creates a warning message in the compile that
WIDEST_UTYPE is redefined, as the definition of that is defective in
PPPort. It should only define it if it wasn't previously defined, and
it is wrongly using the 32 bit version. This is added impetus to get
PPPort fixed
|
|
|
|
|
|
|
|
|
|
|
|
| |
The ones corresponding to shorter sizes, like I32, are available
everywhere. There is no reason to restrict just the 64 variety.
This fixes the bug in the definition for INT64_C and UINT64_C which
caused these to not be defined outside core on some platforms, such as
Windows.
See commit 3edba68397e487b39cca6e7fc0b75ab4a2f6a341 for more
explanation
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
These are steadily being used in more and more macros that are
available to extensions as well as core, but the use of Perl's
home-grown versions (for when we don't get them from stdint.h)
has depended on the definition of HAS_QUAD. However, HAS_QUAD
is explicitly turned off in perl.h when PERL_CORE is not defined,
and has warnings about widespread breakage if that undef were to
be removed (referring to RT #119753). So extensions that use
macros that in turn use INT64_C or UINT64_C were failing to
build.
So in order to know that 64-bit integers are available without
using the HAS_QUAD macro that was intended for just that purpose,
use QUADKIND as a way of saying "We know we had HAS_QUAD before
you hid it from us." Ugh.
|
| |
|
|
|
|
|
|
|
|
|
|
| |
When giving a function-style prototype for a macro taking a literal string
parameter, put a string literal in place of a type for that parameter.
This goofy appearance makes it obvious that this isn't really a function,
and clues the reader in that the parameter can't actually be an arbitrary
expression of the right type. Also change the nonsensical "NUL-terminated
literal string" to "literal string" to describe these parameters.
Fixes [perl #116286].
|
|
|
|
| |
This reverts commit 004073bac990d90244eb463f435c52d4040b36df.
|
| |
|
| |
|
|
|
|
|
|
|
| |
Also:
- factor out common expression
- remove redundant double parens
- add spaces to expression
|
|
|
|
|
| |
This adds a description of the naming conventions to be used for any new
string comparison macros.
|
|
|
|
| |
Until we decide these weren't a bad idea
|
|
|
|
| |
For consistency
|
|
|
|
| |
All uses of these private macros have been replaced by other calls.
|
|
|
|
| |
This corresponds to memBEGINPs
|
|
|
|
|
|
| |
This macro is like memBEGINs(), but the 'P' signifies we want a proper
substring, meaning that the 2nd string parameter must not be the entire
first parameter.
|
|
|
|
|
|
|
|
|
| |
memBEGINs() is like strBEGINs(), but can be used for buffers without
trailing NULs. It can also be used when there is a trailing NUL, and
the length is known, as it should be somewhat faster, only having to
check for one ending condition.
Same for memENDs vs strENDs
|
|
|
|
|
|
|
|
|
|
| |
The original names are confusing.
See thread beginning with
http://nntp.perl.org/group/perl.perl5.porters/244335
The two macros are mapped into just that one, complementing the result
for the few cases where strNEs was used.
|
|
|
|
|
| |
This guarantees the expected precedence no matter what the context it is
called in.
|
| |
|
| |
|
|
|
|
|
|
|
| |
"Sane" means that it works correctly on bytes with their high bit set, as
C89 also requires.
We therefore no longer need to probe for and/or use BSD bcmp().
|
|
|
|
| |
This means we also never need to consider using BSD bzero().
|
|
|
|
|
| |
At least for now, we retain the StructCopy() macro, but its definition
always just uses struct assignment.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
In f14cf363205 we added asserts to our memory macros (Copy(), Zero() etc)
to ensure that the target is non-null. These asserts throw warnings like
perl.c: In function ‘Perl_eval_sv’:
perl.c:2976:264: warning: the address of ‘myop’ will always evaluate
as ‘true’ [-Waddress]
Zero(&myop, 1, UNOP);
which is annoying. This patch changes how these asserts are coded so
we avoid the warning. Thanks to Zefram for the fix.
|
|
|
|
| |
ALign some things vertically for easier reading
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
These functions depend on C library functions which have undefined
behaviour when passed NULL pointers, even when passed a zero 'n' value.
Some compilers use this information, ie. assume the pointers are
non-NULL when optimizing any following code, so we do need to
prevent such unguarded calls.
My initial thought was to add conditionals to each macro to skip the
call to the library function when n is zero, but this adds a cost to
every use of these macros, even when the n value is always true.
So instead I added asserts() which will give us a much more visible
indicator of such broken code and revealed the pp_caller and Glob.xs
issues also patched here.
|
|
|
|
|
|
|
|
|
|
| |
We changed to use symbols not likely to be used by non-Perl code that
could conflict, and which have trailing underbars, so they don't look
like a regular Perl #define.
See https://rt.perl.org/Ticket/Display.html?id=131110
There are many more header files which are not guarded.
|
|
|
|
|
| |
This is so their use cannot spread easily until we have sorted things
out in 5.27
|
|
|
|
|
|
|
|
| |
This reverts commit 84b32f52b10f9912b40ef378cd0b01f4aff80630.
This reverts commit d30393aaade31b605724846a30a10dd1e96cd181.
We need more debate on this one; either we should undeprecate it,
or settle on an end-of-life version.
|
|
|
|
|
|
|
| |
Since we now require each deprecation message to come with a
version in which the feature will disappear, and we have reworked
the existing uses of this macro, there doesn't seem to be a need
for this one anymore.
|
|
|
|
|
| |
Hence, we adapted the warning, to mention the version in which it
will become a fatal error.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The :unique and :locked attributes have had no effect since 5.8.8
and 5.005 respectively. They were deprecated in 5.12. They are now
scheduled to be deleted in 5.28.
There are two places the deprecation warning can be issued:
in lib/attributes.pm, and in toke.c. The warnings were phrased
differently, but since we're changing the warning anyway (as we
added the version of Perl in which the attributes will disappear),
we've used the same phrasing for this warning, regardless of where
it is generated:
Attribute "locked" is deprecated, and will disappear in Perl 5.28
Attribute "unique" is deprecated, and will disappear in Perl 5.28
|
|
|
|
| |
This only affected EBCDIC builds, causing syntax errors.
|
| |
|
|
|
|
| |
Now that there are _safe versions, deprecate the unsafe ones.
|
| |
|
| |
|
|
|
|
|
| |
This creates several macros that future commits will use to provide a
layer between the caller and the function.
|
|
|
|
|
| |
This text appears in the middle of C<>, but is meant to be substituted
for, instead of being typed in as-is.
|
| |
|
|
|
|
|
|
| |
These macros are being replaced by a safe version; they now generate a
deprecation message at each call site upon the first use there in each
program run.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The original API does not check that we aren't reading beyond the end of
a buffer, apparently assuming that we could keep malformed UTF-8 out by
use of gatekeepers, but that is currently impossible. This commit adds
"safe" macros for determining if a UTF-8 sequence represents
an alphabetic, a digit, etc. Each new macro has an extra parameter
pointing to the end of the sequence, so that looking beyond the input
string can be avoided.
The macros aren't currently completely safe, as they don't test that
there is at least a single valid byte in the input, except by an
assertion in DEBUGGING builds. This is because typically they are
called in code that makes that assumption, and frequently tests the
current byte for one thing or another.
|