summaryrefslogtreecommitdiff
path: root/utf8.c
diff options
context:
space:
mode:
authorNicholas Clark <nick@ccl4.org>2008-01-30 23:19:42 +0000
committerNicholas Clark <nick@ccl4.org>2008-01-30 23:19:42 +0000
commit26d21c429e82d8574068f5d94a2490b61c357339 (patch)
tree0d89e246c4f7fc4b144184b3405c44c33728209f /utf8.c
parent77c3d7486f1d8cea0c6aabbadca0ad2e0b03d32a (diff)
downloadperl-26d21c429e82d8574068f5d94a2490b61c357339.tar.gz
Integrate:
[ 32807] Add a new function newSVpvn_flags(), which takes a third parameter of flag bits. Right now the only flag bit is SVf_UTF8, which will call SvUTF8_on() on the new SV for you. Provide a wrapper newSVpvn_utf8(), which takes a boolean, and passes in SVf_UTF8 if that is true. Refactor the core to use it where possible. It makes the source code clearer and smaller, but seems to be swings and roundabouts on object code size. [ 32812] Add HeUTF8() to complement HePV() and then immediately suggest that newSVhek(HeKEY_hek(he) is probably what you wanted all along. [ 32818] Extend newSVpvn_flags() to also call sv_2mortal() if SVs_TEMP is set in the flags. Move its implementation just ahead of sv_2mortal()'s for CPU cache locality. Refactor all code that can be to use this. [ 32819] Add newSVpvs_flags() as a wrapper to newSVpvn_flags(), and rework sv_2mortal(newSVpvs(...)) constructions to use it. [ 32820] Missed three sv_2mortal(newSVpvn(...))s in the headers. [ 32821] Add macros mPUSHs() and mXPUSHs() for pushing SVs on the stack and mortalizing them. Use these macros where possible. And also mX?PUSH[inpu] where possible. [ 32823] Run regen.pl (fixes build on Win32, at least) [ 32824] There's no need to handle 'set' magic in the mX?PUSH macros. The macros all create new mortals using sv_newmortal(), and those cannot be magical. This is in contrary to the X?PUSH macros, which operate on TARG, which can be magical. With that in mind, mentioning whether or not mX?PUSH can handle 'set' magic doesn't make sense any longer. [ 32834] Re-implement mPUSHp() and mXPUSHp() using Perl_newSVpvn_flags(), which results in slightly smaller object code. (No extra work is done.) p4raw-link: @32834 on //depot/perl: 8f14ea018e8d1f6c6a67be29ee2ae899993d0f0e p4raw-link: @32824 on //depot/perl: 121b77126d4ab6098abde56a8c4175a9704d61b2 p4raw-link: @32823 on //depot/perl: ae374e95f2465dddad54f12486ab8266e5ccbb5a p4raw-link: @32821 on //depot/perl: 6e449a3ab1e3bd9d7e138ca681c733e57d4daa49 p4raw-link: @32820 on //depot/perl: ad25789c15269a04312e0efede81842547aa8212 p4raw-link: @32819 on //depot/perl: 84bafc024a74c819ac3d2b4406253dbe983e6502 p4raw-link: @32818 on //depot/perl: 59cd0e26eb6c10499b25d783562357dd68cc16f2 p4raw-link: @32812 on //depot/perl: 289d3c6afee2ee5aaa9c3c2e0498d35fffce0173 p4raw-link: @32807 on //depot/perl: 740cce10afff4bec3346f61ab3d0f7bfa424948c p4raw-id: //depot/maint-5.10/perl@33139 p4raw-integrated: from //depot/perl@33138 'copy in' doop.c (@31270..) XSUB.h (@31697..) xsutils.c (@32237..) gv.c (@32478..) pp_pack.c (@32818..) utf8.c (@32819..) pp.h (@32824..) 'edit in' hv.c (@32807..) mro.c (@32818..) 'merge in' doio.c (@32681..) av.c (@32792..) p4raw-integrated: from //depot/perl@32823 'edit in' embed.h (@32807..) 'merge in' global.sym (@32806..) p4raw-integrated: from //depot/perl@32821 'edit in' perl.c (@32813..) pp_hot.c (@32818..) mg.c pp.c pp_ctl.c pp_sys.c (@32819..) p4raw-integrated: from //depot/perl@32820 'edit in' hv.h (@32812..) p4raw-integrated: from //depot/perl@32819 'copy in' cop.h (@32237..) toke.c (@32818..) 'edit in' universal.c (@32817..) sv.c (@32818..) 'merge in' handy.h (@32793..) p4raw-integrated: from //depot/perl@32818 'edit in' regcomp.c (@32813..) p4raw-integrated: from //depot/perl@32807 'edit in' pod/perlapi.pod (@32707..) sv.h util.c (@32804..) 'merge in' embed.fnc proto.h (@32804..)
Diffstat (limited to 'utf8.c')
-rw-r--r--utf8.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/utf8.c b/utf8.c
index 7bc2b099e8..440ee760e2 100644
--- a/utf8.c
+++ b/utf8.c
@@ -536,7 +536,7 @@ malformed:
}
if (dowarn) {
- SV* const sv = sv_2mortal(newSVpvs("Malformed UTF-8 character "));
+ SV* const sv = newSVpvs_flags("Malformed UTF-8 character ", SVs_TEMP);
switch (warning) {
case 0: /* Intentionally empty. */ break;
@@ -1587,11 +1587,11 @@ Perl_swash_init(pTHX_ const char* pkg, const char* name, SV *listsv, I32 minbits
SPAGAIN;
PUSHMARK(SP);
EXTEND(SP,5);
- PUSHs(sv_2mortal(newSVpvn(pkg, pkg_len)));
- PUSHs(sv_2mortal(newSVpvn(name, name_len)));
+ mPUSHp(pkg, pkg_len);
+ mPUSHp(name, name_len);
PUSHs(listsv);
- PUSHs(sv_2mortal(newSViv(minbits)));
- PUSHs(sv_2mortal(newSViv(none)));
+ mPUSHi(minbits);
+ mPUSHi(none);
PUTBACK;
errsv_save = newSVsv(ERRSV);
if (call_method("SWASHNEW", G_SCALAR))