From: Vincent Pit Date: Wed, 15 Jul 2009 20:32:36 +0000 (+0200) Subject: Document PL_opfreehook X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=2f175318a4bf1a5a0d3c3dfabb9a049ffc16c4e9;p=p5sagit%2Fp5-mst-13.2.git Document PL_opfreehook --- diff --git a/intrpvar.h b/intrpvar.h index 975bab0..9f8e443 100644 --- a/intrpvar.h +++ b/intrpvar.h @@ -170,6 +170,18 @@ PERLVARA(Icolors,6, char *) /* from regcomp.c */ PERLVARI(Ipeepp, peep_t, MEMBER_TO_FPTR(Perl_peep)) /* Pointer to peephole optimizer */ +/* +=for apidoc Amn|Perl_ophook_t|PL_opfreehook + +When non-C, the function pointed by this variable will be called each time an OP is freed with the corresponding OP as the argument. +This allows extensions to free any extra attribute they have locally attached to an OP. +It is also assured to first fire for the parent OP and then for its kids. + +When you replace this variable, it is considered a good practice to store the possibly previously installed hook and that you recall it inside your own. + +=cut +*/ + PERLVARI(Iopfreehook, Perl_ophook_t, 0) /* op_free() hook */ PERLVARI(Imaxscream, I32, -1)