summaryrefslogtreecommitdiffstats
path: root/Stash.xs
diff options
context:
space:
mode:
authorJesse Luehrs <doy@tozt.net>2010-11-13 09:54:05 -0600
committerJesse Luehrs <doy@tozt.net>2010-11-13 09:54:05 -0600
commit6c3e69c69e12f548095b025515a48894d1a73f66 (patch)
tree13da060dda6c037f995c7c857762d52a30a115f6 /Stash.xs
parent58710c0b0c0d861abfef51f0d8b35761035c4f4b (diff)
downloadpackage-stash-xs-6c3e69c69e12f548095b025515a48894d1a73f66.tar.gz
package-stash-xs-6c3e69c69e12f548095b025515a48894d1a73f66.zip
avoid unnecessary mortal
Diffstat (limited to 'Stash.xs')
-rw-r--r--Stash.xs4
1 files changed, 2 insertions, 2 deletions
diff --git a/Stash.xs b/Stash.xs
index ac83c6d..f744723 100644
--- a/Stash.xs
+++ b/Stash.xs
@@ -274,13 +274,13 @@ new(class, package_name)
if (!SvPOK(package_name))
croak("The constructor argument must be the name of a package");
- instance = (HV*)sv_2mortal((SV*)newHV());
+ instance = newHV();
hv_store(instance, "name", 4, SvREFCNT_inc(package_name), 0);
namespace = gv_stashpv(SvPV_nolen(package_name), GV_ADD);
hv_store(instance, "namespace", 9, newRV_inc((SV*)namespace), 0);
- RETVAL = sv_bless(newRV_inc((SV*)instance), gv_stashpv(class, 0));
+ RETVAL = sv_bless(newRV_noinc((SV*)instance), gv_stashpv(class, 0));
OUTPUT:
RETVAL