Add utility macros: newAV_mortal() and newHV_mortal()
gfx [Sun, 15 Nov 2009 04:42:55 +0000 (13:42 +0900)]
mouse.h

diff --git a/mouse.h b/mouse.h
index 3056eeb..fdca9bc 100644 (file)
--- a/mouse.h
+++ b/mouse.h
@@ -38,6 +38,9 @@ AV* mouse_mro_get_linear_isa(pTHX_ HV* const stash);
 #endif /* !no_mro_get_linear_isa */
 #endif /* mro_get_package_gen */
 
+#define newAV_mortal() (AV*)sv_2mortal((SV*)newAV())
+#define newHV_mortal() (HV*)sv_2mortal((SV*)newHV())
+
 #define MOUSE_CALL_BOOT(name) STMT_START {      \
         EXTERN_C XS(CAT2(boot_, name));         \
         PUSHMARK(SP);                           \