Add utility macros: newAV_mortal() and newHV_mortal()
[gitmo/Mouse.git] / 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);                           \