summaryrefslogtreecommitdiff
path: root/embed.fnc
diff options
context:
space:
mode:
authorDavid Mitchell <davem@iabyn.com>2010-04-25 00:56:32 +0100
committerDavid Mitchell <davem@iabyn.com>2010-04-25 00:56:32 +0100
commitefaf36747029c85b4d8825318cb4d485a0bb350e (patch)
tree661fdb2a9c147bd9de3544d4e322e00e59d0b292 /embed.fnc
parentbc354c7012685d70ce64e7f10221b03ea279af01 (diff)
downloadperl-efaf36747029c85b4d8825318cb4d485a0bb350e.tar.gz
add Perl_magic_methcall
Add a new function that wraps the setup needed to call a magic method like FETCH (the existing S_magic_methcall function has been renamed S_magic_methcall1). There is one functional change, done mainly to allow for a single clean wrapper function, and that is that the method calls are no longer wrapped with SAVETMPS/FREETMPS. Previously only about half of them had this, so some relied on the caller to free, some didn't. At least we're consistent now. Doing it this way is necessary because otherwise magic_methcall() can't return an SV (eg for POP) because it'll be a temp and get freed by FREETMPS before it gets returned. So you'd have to copy everything, which would slow things down.
Diffstat (limited to 'embed.fnc')
-rw-r--r--embed.fnc8
1 files changed, 6 insertions, 2 deletions
diff --git a/embed.fnc b/embed.fnc
index 1e3021c483..7412f95435 100644
--- a/embed.fnc
+++ b/embed.fnc
@@ -681,6 +681,9 @@ p |int |magic_setutf8 |NN SV* sv|NN MAGIC* mg
p |int |magic_set_all_env|NN SV* sv|NN MAGIC* mg
p |U32 |magic_sizepack |NN SV* sv|NN MAGIC* mg
p |int |magic_wipepack |NN SV* sv|NN MAGIC* mg
+pd |SV* |magic_methcall |NN SV *sv|NN const MAGIC *mg \
+ |NN const char *meth|I32 flags \
+ |int n|NULLOK SV* arg1|NULLOK SV* arg2
Ap |void |markstack_grow
#if defined(USE_LOCALE_COLLATE)
p |int |magic_setcollxfrm|NN SV* sv|NN MAGIC* mg
@@ -1489,8 +1492,9 @@ sM |SV * |refcounted_he_value |NN const struct refcounted_he *he
#if defined(PERL_IN_MG_C) || defined(PERL_DECL_PROT)
s |void |save_magic |I32 mgs_ix|NN SV *sv
-s |int |magic_methpack |NN SV *sv|NN const MAGIC *mg|NN const char *meth
-s |int |magic_methcall |NN SV *sv|NN const MAGIC *mg|NN const char *meth|I32 f \
+-s |int |magic_methpack |NN SV *sv|NN const MAGIC *mg|NN const char *meth
+s |SV* |magic_methcall1|NN SV *sv|NN const MAGIC *mg \
+ |NN const char *meth|I32 flags \
|int n|NULLOK SV *val
s |void |restore_magic |NULLOK const void *p
s |void |unwind_handler_stack|NN const void *p