From: gfx Date: Sun, 15 Nov 2009 04:42:55 +0000 (+0900) Subject: Add utility macros: newAV_mortal() and newHV_mortal() X-Git-Tag: 0.40_06~20 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=gitmo%2FMouse.git;a=commitdiff_plain;h=327413ed22231607b5c0558bb7561a97158ce202 Add utility macros: newAV_mortal() and newHV_mortal() --- diff --git a/mouse.h b/mouse.h index 3056eeb..fdca9bc 100644 --- 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); \