This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
fix COW match capture optimisation
[perl5.git] / embed.fnc
index af6119b..a85b8a6 100644 (file)
--- a/embed.fnc
+++ b/embed.fnc
@@ -16,7 +16,7 @@
 :         any doc entry goes in perlapi.pod rather than perlintern.pod.  If no
 :           documentation is furnished for this function, and M is also
 :           specified, the function is not listed as part of the public API.
-:           If M isn't specified and no documentation is furnished, the
+:           If M isn't specified, and no documentation is furnished, the
 :           function is listed in perlapi as existing and being undocumented
 :         makes '#define foo Perl_foo' scope not just for PERL_CORE/PERL_EXT
 :
@@ -48,8 +48,9 @@
 :         in embed.h, change "#ifdef PERL_CORE"
 :         into               "#if defined(PERL_CORE) || defined(PERL_EXT)"
 :
-:      Should always be combined with "X" to be usable from dynamically
-:      loaded extensions.
+:      To be usable from dynamically loaded extensions, either:
+:        1) must be static to its containing file ("i" or "s" flag); or
+:         2) be combined with the "X" flag.
 :
 :   f  Function takes printf style format string, varargs (hence any entry that
 :      would otherwise go in embed.h is suppressed):
@@ -265,7 +266,6 @@ Anprd       |void   |croak_no_modify
 Anprd  |void   |croak_xs_usage |NN const CV *const cv \
                                |NN const char *const params
 npr    |void   |croak_no_mem
-nroX   |void   |Perl_croak_memory_wrap
 nprX   |void   |croak_popstack
 #if defined(WIN32)
 norx   |void   |win32_croak_not_implemented|NN const char * fname
@@ -300,8 +300,9 @@ p   |void   |cv_ckproto_len_flags   |NN const CV* cv|NULLOK const GV* gv\
 : Used in pp.c and pp_sys.c
 ApdR   |SV*    |gv_const_sv    |NN GV* gv
 ApdR   |SV*    |cv_const_sv    |NULLOK const CV *const cv
+pR     |SV*    |cv_const_sv_or_av|NULLOK const CV *const cv
 : Used in pad.c
-pR     |SV*    |op_const_sv    |NULLOK const OP* o|NULLOK CV* cv
+pR     |SV*    |op_const_sv    |NULLOK const OP* o
 Apd    |void   |cv_undef       |NN CV* cv
 p      |void   |cv_forget_slab |NN CV *cv
 Ap     |void   |cx_dump        |NN PERL_CONTEXT* cx
@@ -323,6 +324,7 @@ Ap  |void   |debprofdump
 Ap     |I32    |debop          |NN const OP* o
 Ap     |I32    |debstack
 Ap     |I32    |debstackptrs
+pR     |SV *   |defelem_target |NN SV *sv|NULLOK MAGIC *mg
 Anp    |char*  |delimcpy       |NN char* to|NN const char* toend|NN const char* from \
                                |NN const char* fromend|int delim|NN I32* retlen
 : Used in op.c, perl.c
@@ -842,6 +844,8 @@ Apd |int    |mg_copy        |NN SV *sv|NN SV *nsv|NULLOK const char *key \
 pd     |void   |mg_localize    |NN SV* sv|NN SV* nsv|bool setmagic
 ApdR   |MAGIC* |mg_find        |NULLOK const SV* sv|int type
 ApdR   |MAGIC* |mg_findext     |NULLOK const SV* sv|int type|NULLOK const MGVTBL *vtbl
+: exported for re.pm
+EXpR   |MAGIC* |mg_find_mglob  |NN SV* sv
 Apd    |int    |mg_free        |NN SV* sv
 Apd    |void   |mg_free_type   |NN SV* sv|int how
 Apd    |int    |mg_get         |NN SV* sv
@@ -1084,8 +1088,8 @@ Ap        |SV*    |regclass_swash |NULLOK const regexp *prog \
                                |NN const struct regnode *node|bool doinit \
                                |NULLOK SV **listsvp|NULLOK SV **altsvp
 #ifdef PERL_IN_REGCOMP_C
-EMsR   |SV*    |_new_invlist_C_array|NN UV* list
-: Not used currently: EXMs     |bool   |_invlistEQ     |NN SV* const a|NN SV* const b|bool complement_b
+EMsR   |SV*    |_new_invlist_C_array|NN const UV* const list
+: Not used currently: EXMs     |bool   |_invlistEQ     |NN SV* const a|NN SV* const b|const bool complement_b
 #endif
 Ap     |I32    |pregexec       |NN REGEXP * const prog|NN char* stringarg \
                                |NN char* strend|NN char* strbeg|I32 minend \
@@ -1123,7 +1127,6 @@ Ap        |I32    |regexec_flags  |NN REGEXP *const rx|NN char *stringarg \
                                |NN char *strend|NN char *strbeg|I32 minend \
                                |NN SV *sv|NULLOK void *data|U32 flags
 ApR    |regnode*|regnext       |NULLOK regnode* p
-
 EXp |SV*|reg_named_buff          |NN REGEXP * const rx|NULLOK SV * const key \
                                  |NULLOK SV * const value|const U32 flags
 EXp |SV*|reg_named_buff_iter     |NN REGEXP * const rx|NULLOK const SV * const lastkey \
@@ -1360,6 +1363,8 @@ Apd       |void   |sv_magic       |NN SV *const sv|NULLOK SV *const obj|const int how \
 Apd    |MAGIC *|sv_magicext    |NN SV *const sv|NULLOK SV *const obj|const int how \
                                |NULLOK const MGVTBL *const vtbl|NULLOK const char *const name \
                                |const I32 namlen
+: exported for re.pm
+EXp    |MAGIC *|sv_magicext_mglob|NN SV *sv
 ApdbamR        |SV*    |sv_mortalcopy  |NULLOK SV *const oldsv
 XpaR   |SV*    |sv_mortalcopy_flags|NULLOK SV *const oldsv|U32 flags
 ApdR   |SV*    |sv_newmortal
@@ -1369,6 +1374,8 @@ Apd       |void   |sv_pos_u2b     |NULLOK SV *const sv|NN I32 *const offsetp|NULLOK I32 *con
 Apd    |STRLEN |sv_pos_u2b_flags|NN SV *const sv|STRLEN uoffset \
                                |NULLOK STRLEN *const lenp|U32 flags
 Apd    |void   |sv_pos_b2u     |NULLOK SV *const sv|NN I32 *const offsetp
+Apd    |STRLEN |sv_pos_b2u_flags|NN SV *const sv|STRLEN const offset \
+                                |U32 flags
 Amdb   |char*  |sv_pvn_force   |NN SV* sv|NULLOK STRLEN* lp
 Apd    |char*  |sv_pvutf8n_force|NN SV *const sv|NULLOK STRLEN *const lp
 Apd    |char*  |sv_pvbyten_force|NN SV *const sv|NULLOK STRLEN *const lp
@@ -1428,17 +1435,15 @@ EsM     |void   |_append_range_to_invlist   |NN SV* const invlist|const UV start|const
 EiMR   |UV*    |_invlist_array_init    |NN SV* const invlist|const bool will_have_0
 EiMR   |UV*    |invlist_array  |NN SV* const invlist
 EsM    |void   |invlist_extend    |NN SV* const invlist|const UV len
-EiMR   |UV*    |get_invlist_zero_addr  |NN SV* invlist
 EiMR   |UV     |invlist_max    |NN SV* const invlist
-EiM    |void   |invlist_set_len|NN SV* const invlist|const UV len
+EiM    |void   |invlist_set_len|NN SV* const invlist|const UV len|const bool offset
 EiMR   |IV*    |get_invlist_previous_index_addr|NN SV* invlist
 EiMR   |IV     |invlist_previous_index|NN SV* const invlist
 EiM    |void   |invlist_set_previous_index|NN SV* const invlist|const IV index
 EiM    |void   |invlist_trim   |NN SV* const invlist
 EiMR   |SV*    |invlist_clone  |NN SV* const invlist
 EiMR   |bool   |invlist_is_iterating|NN SV* const invlist
-EiMR   |UV*    |get_invlist_iter_addr  |NN SV* invlist
-EiMR   |UV*    |get_invlist_version_id_addr    |NN SV* invlist
+EiMR   |STRLEN*|get_invlist_iter_addr  |NN SV* invlist
 EiM    |void   |invlist_iterinit|NN SV* invlist
 EsMR   |bool   |invlist_iternext|NN SV* invlist|NN UV* start|NN UV* end
 EiM    |void   |invlist_iterfinish|NN SV* invlist
@@ -1446,9 +1451,13 @@ EiMR     |UV     |invlist_highest|NN SV* const invlist
 #endif
 #if defined(PERL_IN_REGCOMP_C) || defined(PERL_IN_UTF8_C)
 EXmM   |void   |_invlist_intersection  |NN SV* const a|NN SV* const b|NN SV** i
-EXpM   |void   |_invlist_intersection_maybe_complement_2nd|NULLOK SV* const a|NN SV* const b|bool complement_b|NN SV** i
+EXpM   |void   |_invlist_intersection_maybe_complement_2nd \
+               |NULLOK SV* const a|NN SV* const b          \
+               |const bool complement_b|NN SV** i
 EXmM   |void   |_invlist_union |NULLOK SV* const a|NN SV* const b|NN SV** output
-EXpM   |void   |_invlist_union_maybe_complement_2nd|NULLOK SV* const a|NN SV* const b|bool complement_b|NN SV** output
+EXpM   |void   |_invlist_union_maybe_complement_2nd        \
+               |NULLOK SV* const a|NN SV* const b          \
+               |const bool complement_b|NN SV** output
 EXmM   |void   |_invlist_subtract|NN SV* const a|NN SV* const b|NN SV** result
 EXpM   |void   |_invlist_invert|NN SV* const invlist
 EXpM   |void   |_invlist_invert_prop|NN SV* const invlist
@@ -1464,7 +1473,7 @@ EXp       |SV*    |_core_swash_init|NN const char* pkg|NN const char* name \
 #endif
 #if defined(PERL_IN_REGCOMP_C) || defined(PERL_IN_REGEXEC_C) || defined(PERL_IN_UTF8_C)
 EXMpR  |SV*    |_invlist_contents|NN SV* const invlist
-EiMR   |UV*    |_get_invlist_len_addr  |NN SV* invlist
+EiMR   |bool*  |get_invlist_offset_addr|NN SV* invlist
 EiMR   |UV     |_invlist_len   |NN SV* const invlist
 EMiR   |bool   |_invlist_contains_cp|NN SV* const invlist|const UV cp
 EXpMR  |IV     |_invlist_search        |NN SV* const invlist|const UV cp
@@ -1609,6 +1618,7 @@ Anpa      |Malloc_t|safesysmalloc |MEM_SIZE nbytes
 Anpa   |Malloc_t|safesyscalloc |MEM_SIZE elements|MEM_SIZE size
 Anpa   |Malloc_t|safesysrealloc|Malloc_t where|MEM_SIZE nbytes
 Anp    |Free_t |safesysfree    |Malloc_t where
+Asrnx  |void   |croak_memory_wrap
 #if defined(PERL_GLOBAL_STRUCT)
 Ap     |struct perl_vars *|GetVars
 Ap     |struct perl_vars*|init_global_struct
@@ -2212,7 +2222,7 @@ s |char*  |scan_word      |NN char *s|NN char *dest|STRLEN destlen \
                                |int allow_package|NN STRLEN *slp
 s      |void   |update_debugger_info|NULLOK SV *orig_sv \
                                |NULLOK const char *const buf|STRLEN len
-sR     |char*  |skipspace      |NN char *s
+sR     |char*  |skipspace_flags|NN char *s|U32 flags
 sR     |char*  |swallow_bom    |NN U8 *s
 #ifndef PERL_NO_UTF16_FILTER
 s      |I32    |utf16_textfilter|int idx|NN SV *sv|int maxlen
@@ -2450,7 +2460,7 @@ poM       |AV**   |hv_backreferences_p    |NN HV *hv
 poM    |void   |hv_kill_backrefs       |NN HV *hv
 #endif
 Apd    |void   |hv_clear_placeholders  |NN HV *hv
-ApoR   |I32*   |hv_placeholders_p      |NN HV *hv
+XpoR   |SSize_t*|hv_placeholders_p     |NN HV *hv
 ApoR   |I32    |hv_placeholders_get    |NN const HV *hv
 Apo    |void   |hv_placeholders_set    |NN HV *hv|I32 ph