| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
| |
file level macro
|
| |
|
|
|
|
| |
Signed-off-by: Yves Orton <demerphq@gemini.(none)>
|
|
|
|
|
| |
Check position relative to end of string length rather than whether
char is NULL at end of initial alphanumerics in Perl_sv_inc
|
|
|
|
| |
This fixes [perl #68590] : %^H not lexical enough.
|
|
|
|
| |
and tweaking Perl_sv_upgrade().
|
| |
|
|
|
|
|
| |
*after* we have called any CLONE methods
(better fix for Variable::Magic than 240bfeb992)
|
|
|
|
|
|
| |
Commit 7c4baf47da introduced the saved_curcop field of PL_parser,
but omitted to copy the entry during interpreter cloning.
This may fix bugs [RT #58468], [RT #59498]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Patch modified to use a boolean rather than an integer for tracking
mro changes in S_glob_assign_ref and test fixed not to warn.
URL: http://rt.perl.org/rt3/Ticket/Display.html?id=60220
From the bug report:
-----------------------------------------------------------------
When creating a subclass dynamically, and when adding
AUTOLOAD dynamically into the parent class, then that
AUTOLOAD is not seen in the method cache, even after
a call to "mro::method_changed_in('Parent')".
It only appears in the method cache after a call
to mro::invalidate_all_method_caches().
The attached test file demonstrates the problem.
This was detected while trying to solve bug 40159 in DBIx::DataModel.
-----------------------------------------------------------------
Message-ID: <20081031132021.GA21341@mars.tony.develop-help.com>
|
|
|
|
|
|
|
|
|
|
| |
This avoids tripping over alignment differences between X* and x*_allocated,
because x*_allocated doesn't have a double in it.
Tidy up the documentation in comments. Eliminate relative_STRUCT_OFFSET() as
it is no longer used. Eliminate use of xpv_allocated, xpviv_allocated,
xpvav_allocated, xpvcv_allocated and xpvfm_allocated, but leave them in the
headers as they are publicly visible.
|
|
|
|
|
|
| |
Calculate memory allocation using regexp and XPVIO, and the offset of the first
real structure member. This avoids tripping over alignment differences between
X* and x*_allocated, because x*_allocated doesn't have a double in it.
|
| |
|
|
|
|
| |
matching entry in perldiag (and fix it so that more of the existing ones do).
|
|
|
|
| |
(that was introduced by 9ef5ed94af)
|
|
|
|
|
|
|
| |
sv_pos_u2b, when utf8 position caching is enabled, treats the uoffset
it is given as real, storing it away for lature use. sprintf, here,
passes the byte length of the string, which causes an invalid offset
to be cached.
|
|
|
|
| |
in scalar context
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
(The table is 256 bytes; the run-time initialisation code is larger than this!)
Adapt generate_uudmap.c to generate the initalisation block for PL_bitcount,
writing the code to bitcount.h, using the same approach as uudmap.h.
To preserve binary compatibility:
for MULTIPLICITY:
keep Ibitcount in the interpreter structure, but remove all the macros that
access it. PL_bitcount is a new symbol in the object file, which won't clash
with anything as that name wasn't used before.
otherwise:
keep PL_bitcount as a char *, but initialise it at compile time to a new
constant array PL_bitcount array. Remove the code that attempts to Safefree()
it at interpreter destruction time.
|
|
|
|
| |
Avoid using Newxz() to zero allocate memory we will immediately overwrite.
|
|
|
|
| |
Just 4 uses already give a size saving with gcc -Os.
|
| |
|
|
|
|
|
| |
(There's no need to zero-allocate memory for a structure when you're about to
explicitly allocate every member.)
|
|
|
|
|
|
|
|
| |
As all the structure elements are directly assigned to, use Newx() rather than
Newxz(). Replace the explicit assignments with a direct structure copy. When
reading values from the parent, read from those copied to the new structure,
rather than the identical value in the old structure, to recduce CPU cache
pressure.
|
|
|
|
| |
the address of the structure, with a special case for the first time round.
|
| |
|
| |
|
|
|
|
| |
Change 27942 missed this. (675c862fe1d4abfd048dce5f1958cca54b16c501)
|
| |
|
|
|
|
| |
Change its callers to take advantage of this.
|
| |
|
|
|
|
|
|
|
|
| |
(MacOS support was removed from MakeMaker in 6.22, and merged to blead on
15th December 2004 with 5dca256ec738057dc331fb644a93eca44ad5fa14. After this
point MacOS wouldn't even have been able to build the perl binary, because it
would not have been able to build DynaLoader. If anyone wishes to resurrect
MacOS, start by reversing this commit and the relevant part of that commit.)
|
|
|
|
|
| |
These would only have been relevant if running under 5005 threads, which is long
dead.
|
| |
|
|
|
|
| |
Don't call DESTROY if it's a constant subroutine.
|
| |
|
| |
|
|
|
|
| |
apidocs
|
| |
|
| |
|
|
|
|
| |
(and run "make regen")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Consider what currently happens when the tokenizer is scanning a string.
It looks through it byte-by-byte until it finds a character that forces
it to decide to go to utf8. It then calls sv_utf8_upgrade() with the
portion of the string scanned so far.
sv_utf8_upgrade() starts over from the beginning, and scans the string
byte-by-byte until it finds a character that varies between non-utf8 and
utf8. It then calls bytes_to_utf8().
bytes_to_utf8() allocates a new string that can handle the worst case
expansion, 2n+1, of the entire string, and starts over from the
beginning, and scans the input string byte-by-byte copying and
converting each character to the output string as it goes.
It doesn't return the size of the new string, so sv_utf8_upgrade()
assumes it is only as big as what actually got converted, throwing away
knowledge of any spare.
It then returns to the tokenizer, which immediately does a grow to get
space for the unparsed input. This is likely to cause a new string to
be allocated and copied from the one we had just created, even if that
string in actuality had enough space in it.
Thus, the invariant head portion of the string is scanned 3 times, and
probably 2 strings will be allocated and copied.
My solution to cutting this down is to do several things.
First, I added an extra flag for sv_utf8_upgrade that says don't bother
to check if the string needs to be converted to utf8, just assume it
does. This eliminates one of the passes.
I also added a new parameter to sv_utf8_upgrade that says when you
return, I want this much unused space in the string. That eliminates
the extra grow.
This was all done by renaming the current work-horse function from
sv_utf8_upgrade_flags to be sv_utf8_upgrade_flags_grow() and making the
current function name be a macro which calls the revised one with a 0
grow parameter.
I also improved the internal efficiency of sv_utf8_upgrade so that when
it does scan the string, it doesn't call bytes_to_utf8, but does the
conversion itself, using a fast memory copy instead of the byte-oriented
one for the invariant header, and it uses that header to get a better
estimate of the needed size of the new string, and it doesn't throw away
the knowledge of the allocated size.
And, if it is clear without scanning the whole string that the
conversion will fit in the already allocated string, it just uses that
instead of allocating and copying a new one, using the algorithm I
copied from the tokenizer. (In this case it does have to finish
scanning the whole string to get the correct size.) The comments have
details.
It still is byte-oriented. Vectorization et. al. could yield
performance improvements. One idea for that is in the comments.
The patch also includes a new synonym I created which is a more accurate
name than NATIVE_TO_ASCII.
|
|
|
|
|
|
| |
Perl_mro_get_from_name() to retrieve MROs by name, and PL_registered_mros to
store them in. Abolish the static array of mros, and instead register the dfs
and c3 MRO structures.
|
|
|
|
|
|
|
|
|
| |
Testing the ARRAY pointer is insufficent. Arrays emptied by 'shift' or
'pop' may still have non-NULL 'ARRAY' pointers. Check more carefully to
determine whether the array has anything worth duplicating. If not, reset
the FILL and MAX offsets to -1 just as 'undef @ARRAY' would.
This avoids potential corruption in the PL_ptr_table during perl_clone().
|
| |
|
|
|
|
|
| |
but is failing on Windows. Anyways sv_utf8_upgrade_nomg() is
a macro anyways, so moving the documentation to sv.h.
|
|
|
|
|
|
| |
From: karl williamson <public@khwilliamson.com>
Date: Tue, 16 Dec 2008 16:00:34 -0700
Message-ID: <49483312.80804@khwilliamson.com>
|