summaryrefslogtreecommitdiff
path: root/perl.h
diff options
context:
space:
mode:
authorMarcus Holland-Moritz <mhx-perl@gmx.net>2004-09-08 18:46:56 +0000
committerMarcus Holland-Moritz <mhx-perl@gmx.net>2004-09-08 18:46:56 +0000
commit8fba5d14715902515f3d1a2ba75483f168b44cbb (patch)
treeebcd9a68dc546c84139edf34a68b90e7f549c40d /perl.h
parent7252851f9977dfc5c982b985eeabcb43c006d03e (diff)
downloadperl-8fba5d14715902515f3d1a2ba75483f168b44cbb.tar.gz
Add MY_CXT_CLONE to the core. (Taken from Time::HiRes.) See also:
http://groups.google.com/groups?selm=r5l1vv00ca033k7a06d40fgei1ion91rnp%404ax.com p4raw-id: //depot/perl@23279
Diffstat (limited to 'perl.h')
-rw-r--r--perl.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/perl.h b/perl.h
index 99449e7899..46a7a86881 100644
--- a/perl.h
+++ b/perl.h
@@ -4362,6 +4362,13 @@ typedef struct am_table_short AMTS;
Zero(my_cxtp, 1, my_cxt_t); \
sv_setuv(my_cxt_sv, PTR2UV(my_cxtp))
+/* Clones the per-interpreter data. */
+#define MY_CXT_CLONE \
+ dMY_CXT_SV; \
+ my_cxt_t *my_cxtp = (my_cxt_t*)SvPVX(newSV(sizeof(my_cxt_t)-1));\
+ Copy(INT2PTR(my_cxt_t*, SvUV(my_cxt_sv)), my_cxtp, 1, my_cxt_t);\
+ sv_setuv(my_cxt_sv, PTR2UV(my_cxtp))
+
/* This macro must be used to access members of the my_cxt_t structure.
* e.g. MYCXT.some_data */
#define MY_CXT (*my_cxtp)
@@ -4381,6 +4388,7 @@ typedef struct am_table_short AMTS;
#define dMY_CXT_SV dNOOP
#define dMY_CXT dNOOP
#define MY_CXT_INIT NOOP
+#define MY_CXT_CLONE NOOP
#define MY_CXT my_cxt
#define pMY_CXT void