| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
| |
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>
|
|
|
|
|
| |
Message-ID: <20081127070141.GD17663@tytlal.topaz.cx>
p4raw-id: //depot/perl@35018
|
|
|
|
|
| |
SAVEt_DELETE for a space optimisation.
p4raw-id: //depot/perl@34969
|
|
|
| |
p4raw-id: //depot/perl@34967
|
|
|
|
|
| |
This brings it to the same order as save_aelem() or save_pushi32ptr().
p4raw-id: //depot/perl@34964
|
|
|
| |
p4raw-id: //depot/perl@34938
|
|
|
|
|
| |
Message-ID: <20081114084436.GJ5779@tytlal.topaz.cx>
p4raw-id: //depot/perl@34831
|
|
|
|
|
| |
Also add new SvRV_const() macro for read-only access.
p4raw-id: //depot/perl@34804
|
|
|
|
|
|
| |
tests introduced with #34781 pass. Add some more warning
tests to t/lib/warnings/sv.
p4raw-id: //depot/perl@34783
|
|
|
|
|
|
|
| |
Message-Id: <200811081329.mA8DTv7e018896@zen.crypt.org>
Plus some test cases.
p4raw-id: //depot/perl@34780
|
|
|
|
|
|
|
| |
MUTABLE_SV() check. Use SvPVX_const() instead of SvPVX()
where only a const SV* is available. Also fix two falsely
consted pointers in Perl_sv_2pv_flags().
p4raw-id: //depot/perl@34770
|
|
|
|
|
|
| |
Message-ID: <25940.1225611819@chthon>
Date: Sun, 02 Nov 2008 01:43:39 -0600
p4raw-id: //depot/perl@34698
|
|
|
|
|
|
| |
This is mostly to silence gcc's warning, "format not a string
literal and no format arguments".
p4raw-id: //depot/perl@34694
|
|
|
|
|
|
| |
Can't easily do gv.h, as GvGP() (at least) needs to split into two
macros - one const for reading, one non-const for writing.
p4raw-id: //depot/perl@34679
|
|
|
|
|
| |
const SV *, then so can Perl_report_uninit().
p4raw-id: //depot/perl@34673
|
|
|
|
|
| |
Perl_sv_magicext(), which is documented.
p4raw-id: //depot/perl@34671
|
|
|
| |
p4raw-id: //depot/perl@34654
|
|
|
| |
p4raw-id: //depot/perl@34653
|
|
|
| |
p4raw-id: //depot/perl@34650
|
|
|
| |
p4raw-id: //depot/perl@34647
|
|
|
|
|
| |
its arguments.
p4raw-id: //depot/perl@34646
|
|
|
| |
p4raw-id: //depot/perl@34629
|
|
|
| |
p4raw-id: //depot/perl@34627
|
|
|
|
|
| |
(const HV *).
p4raw-id: //depot/perl@34626
|
|
|
| |
p4raw-id: //depot/perl@34623
|
|
|
| |
p4raw-id: //depot/perl@34585
|
|
|
|
|
| |
from 'void *' explicit.
p4raw-id: //depot/perl@34576
|
|
|
|
|
| |
Message-ID: <20081022013731.23b5a2e5@r2d2>
p4raw-id: //depot/perl@34568
|
|
|
|
|
|
|
| |
be reset if its SV is freed. (see change 22688 (30952)).
A real live bug found by Slaven and Andreas whilst smoking maint-5.8.x.
I guess that we should audit the interpreter structure for any others.
p4raw-id: //depot/perl@34479
|
|
|
|
|
| |
The bug turns out to have been introduced in 2003, with change 18580.
p4raw-id: //depot/perl@34371
|
|
|
|
|
| |
This may still be referenced, so don't reuse.
p4raw-id: //depot/perl@34220
|
|
|
|
|
|
|
| |
key scalar from the key of the hash entry we've just creating.
(Currently the hash is disposed of afterwards, but soon it won't, so
having both point to the same string buffer will also save memory.)
p4raw-id: //depot/perl@34215
|
|
|
|
|
| |
unitialised reads (and sometimes even SEGVs).
p4raw-id: //depot/perl@34213
|
|
|
| |
p4raw-id: //depot/perl@34211
|
|
|
|
|
|
|
|
|
|
|
| |
In several places where the weakrefs backreferences array is used
or freed, the code checks whether the array has already been freed
and if so skips. Since the array already being freed is a bad bug,
lets instead assert that this never happens, based on the
assumptions that (a) such premature freeing bugs are likely ironed
out by now, (b) if they aren't then we want to know about them and
fix them rather than silently skip.
p4raw-id: //depot/perl@34210
|
|
|
|
|
|
|
|
|
|
|
| |
A weakref to a HV would leak, because the xhv_backreferences
array is created with a refcount of 2 (to avoid premature freeing
during global destruction), but the RC was only decremented once
when the parent HV was freed.
Also, when thread cloned, the new array was being created with a
RC of 1, rather than 2, which coincidentally worked due to the
first bug.
p4raw-id: //depot/perl@34209
|
|
|
|
|
|
| |
34138, spotted by Jerry D. Hedden. I assume that he's compiling with
options that enable trace flow analysis from the C compiler.
p4raw-id: //depot/perl@34144
|