| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
| |
Old versions (3.3.6) of gcc allowed assignment to such casts, but
this is no longer an issue.
|
|
|
|
| |
moved to sv_inline.h
|
|
|
|
|
|
|
|
| |
Gives a new name `SVphv_HasAUX` to the `SVf_OOK` flag, for use on HVs.
For back-compatibility with existing code we'll have to continue to use
the same bit position, at least for now. But at least code can use this
new name to be clearer about its intent.
|
|
|
|
|
| |
This changes all the API macros that retrieve a PV into a call to an
inline function so as to evaluate the parameter just once.
|
|
|
|
|
| |
This was meant to be a part of the previous commit, but somehow got
omitted.
|
|
|
|
|
|
| |
Since these are defined for just the core, we can add
STMT_START { ... } STMT_END
without repercussions
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
| |
This required making it into an inline function. I tried using
STMT_START{ ... } STMT_END, which should work since it has a void
return, but there were places where it was used in a comma operator, and
those did not compile.
|
|
|
|
| |
So that they will evaluate the argument just once.
|
| |
|
|
|
|
| |
by making the macro instead an inline function
|
|
|
|
| |
This makes it match all the similar functions.
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The new bool "type" does not have the usual complement of utility
functions and macros. It only has one encapsulating function, which is
perfectly reasonable for most use cases where one wants to test if an
SV* is a bool, but does a bit too much if one is working on a
serialization tool which is likely to want to unroll a nice chunk of the
logic.
The new type also lacks the usual cohort of utility functions to create
new bool SV's.
This patch adds the following functions:
newSVbool(const bool bool_val)
newSV_true()
newSV_false()
sv_set_true(SV *sv)
sv_set_false(SV *sv)
sv_set_bool(SV *sv, const bool bool_val)
And the following macros:
SvIandPOK(sv)
SvIandPOK_off(sv)
SvIandPOK_on(sv)
The following three are intended very specifically for writing
serialization code like for Sereal, where it is reasonable to want to
unroll the logic contained in Perl_sv_isbool() and SvTRUE(). They are
documented as "you dont want to use this except under special
circumstances".
SvBoolFlagsOK(sv)
BOOL_INTERNALS_sv_isbool(sv)
BOOL_INTERNALS_sv_isbool_true(sv)
BOOL_INTERNALS_sv_isbool_false(sv)
SvBoolFlagsOK() is documented as being the same as SvIandPOK(),
but this abstracts the intent from the implementation.
|
| |
|
| |
|
| |
|
|
|
|
|
|
| |
Tainting is so specialized that things dealing with it are better
gathered together in one place. This commit moves the existing docs for
such API into the new section
|
| |
|
|
|
|
|
|
| |
These entries that are minor variants of each other were consolidated
into one over-arching entry, but the individual ones were inadvertently
retained, leading to duplicate information.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
When a new SV is created and upgraded to a type known at compile time,
uprooting a SV head and then using the general-purpose upgrade function
(sv_upgrade) is clunky. Specifically, while uprooting a SV head is
lightweight (assuming there are unused SVs), sv_upgrade is too big to be
inlined, contains many branches that can logically be resolved at compile
time for known start & end types, and the lookup of the correct
body_details struct may add CPU cycles.
This commit tries to address that by making newSV_type an inline function
and including only the parts of sv_upgrade needed to upgrade a SVt_NULL.
When the destination type is known at compile time, a decent compiler will
inline a call to newSV_type and use the type information to throw away all
the irrelevant parts of the sv_upgrade logic.
Because of the spread of type definitions across header files, it did not
seem possible to make the necessary changed inside sv.h, and so a new
header file (sv_inline.h) was created. For the inlined function to work
outside of sv.c, many definitions from that file were moved to sv_inline.h.
Finally, in order to also benefit from this change, existing code in sv.c
that does things like this:
SV* sv;
new_SV(sv);
sv_upgrade(sv, SVt_PV)
has been modified to read something like:
SV* sv = newSV_type(SVt_PV);
|
|
|
|
|
| |
This "teaches" them the new SV flags combination implemented by the previous
commit.
|
| |
|
| |
|
|
|
|
|
|
|
|
| |
Default to the smaller body, and switch to the larger body if we need to
allocate a C<struct xpvhv_aux> (eg need an iterator).
This restores the previous small size optimisation for hashes used as
objects.
|
|
|
|
|
|
| |
The longer name more accurately reflects what the constant refers to.
Correct the comments describing how some arena roots are re-used.
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
These are identified as being static shared COW strings whose string
buffer points directly at PL_Yes / PL_No
Define sv_setbool() and sv_setbool_mg() macros
Use sv_setbool() where appropriate
Have sv_dump() annotate when an SV's PV buffer is one of the PL_(Yes|No) special booleans
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Previously, when IsCOW flag was set there were two cases:
SvLEN()==0:
PV is really a shared HEK
SvLEN()!=0:
PV is a COW structure with 1..256 refcount stored in its extra final byte
This change adds a third state:
SvLEN()==0 && SvFLAGS() & SVppv_STATIC:
PV is a shared static const pointer and must not be modified
sv_setsv_flags() and sv_setsv_cow() will preserve this state
sv_uncow() will copy it out to a regular string buffer
sv_dup() will preserve the static pointer into cloned threads
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
| |
perlguts, perlxs, perlxstut, and perlapi.
Issue #18600
|
| |
|
| |
|
|
|
|
| |
This was causing a podcheck error
|
| |
|
| |
|
| |
|
|
|
|
| |
This came about in a rebasing error
|
| |
|
|
|
|
| |
These should also be in the SV section instead of Magic
|
|
|
|
| |
5.32 did this for one form; now all do.
|
| |
|
| |
|
| |
|
| |
|