From 346c6a2954c23fb46d892160e65f9ea2d7d4a4fd Mon Sep 17 00:00:00 2001 From: David Mitchell Date: Thu, 4 Aug 2016 11:47:02 +0100 Subject: [PATCH] remove most 'a' flags from embed.fnc From: http://nntp.perl.org/group/perl.perl5.porters/237910: In embed.fnc, we mark about 80 functions with the a flag, which we document as meaning: : a Allocates memory a la malloc/calloc. Also implies "R": : : proto.h: add __attribute__malloc__ Now, the current gcc docs for the malloc attribute states: This tells the compiler that a function is malloc-like, i.e., that the pointer P returned by the function cannot alias any other pointer valid when the function returns, and moreover no pointers to valid objects occur in any storage addressed by P. Using this attribute can improve optimization. Functions like malloc and calloc have this property because they return a pointer to uninitialized or zeroed-out storage. However, functions like realloc do not have this property, as they can return a pointer to storage containing pointers. This implies to me that we should only flag functions as 'a' if both: 1) it returns a pointer to memory that isn't pointed to from elsewhere; 2) that the block of memory itself contains no pointers. I think we are failing condition (2) for many 'a' functions; for example the op.c newXXXOP() functions return an alloced op struct (condition 1 probably satisfied), but which contain pointers (condition 2 fails). --- embed.fnc | 142 ++++++++++++++++++++++++++++++++------------------------------ proto.h | 67 ----------------------------- 2 files changed, 73 insertions(+), 136 deletions(-) diff --git a/embed.fnc b/embed.fnc index adccf0c..5f2c580 100644 --- a/embed.fnc +++ b/embed.fnc @@ -23,7 +23,11 @@ : If the function is only exported for use in a public : macro, see X. : -: a Allocates memory a la malloc/calloc. Also implies "R": +: a Allocates memory a la malloc/calloc. Also implies "R". +: This should only be on functions which returns 'empty' memory +: which has no other pointers to it, and which does not contain +: any pointers to other things. So for example realloc() can't be +: 'a'. : : proto.h: add __attribute__malloc__ : @@ -202,7 +206,7 @@ Ano |PerlInterpreter*|perl_clone_using \ Aanop |Malloc_t|malloc |MEM_SIZE nbytes Aanop |Malloc_t|calloc |MEM_SIZE elements|MEM_SIZE size -Aanop |Malloc_t|realloc |Malloc_t where|MEM_SIZE nbytes +ARnop |Malloc_t|realloc |Malloc_t where|MEM_SIZE nbytes Anop |Free_t |mfree |Malloc_t where #if defined(MYMALLOC) npR |MEM_SIZE|malloced_size |NN void *p @@ -986,28 +990,28 @@ Afp |char * |my_strftime |NN const char *fmt|int sec|int min|int hour|int mday|i p |void |my_unexec AbDMnPR |UV |NATIVE_TO_NEED |const UV enc|const UV ch AbDMnPR |UV |ASCII_TO_NEED |const UV enc|const UV ch -Apa |OP* |newANONLIST |NULLOK OP* o -Apa |OP* |newANONHASH |NULLOK OP* o +ApR |OP* |newANONLIST |NULLOK OP* o +ApR |OP* |newANONHASH |NULLOK OP* o Ap |OP* |newANONSUB |I32 floor|NULLOK OP* proto|NULLOK OP* block -Apda |OP* |newASSIGNOP |I32 flags|NULLOK OP* left|I32 optype|NULLOK OP* right -Apda |OP* |newCONDOP |I32 flags|NN OP* first|NULLOK OP* trueop|NULLOK OP* falseop +ApdR |OP* |newASSIGNOP |I32 flags|NULLOK OP* left|I32 optype|NULLOK OP* right +ApdR |OP* |newCONDOP |I32 flags|NN OP* first|NULLOK OP* trueop|NULLOK OP* falseop Apd |CV* |newCONSTSUB |NULLOK HV* stash|NULLOK const char* name|NULLOK SV* sv Apd |CV* |newCONSTSUB_flags|NULLOK HV* stash \ |NULLOK const char* name|STRLEN len \ |U32 flags|NULLOK SV* sv Ap |void |newFORM |I32 floor|NULLOK OP* o|NULLOK OP* block -Apda |OP* |newFOROP |I32 flags|NULLOK OP* sv|NN OP* expr|NULLOK OP* block|NULLOK OP* cont -Apda |OP* |newGIVENOP |NN OP* cond|NN OP* block|PADOFFSET defsv_off -Apda |OP* |newLOGOP |I32 optype|I32 flags|NN OP *first|NN OP *other +ApdR |OP* |newFOROP |I32 flags|NULLOK OP* sv|NN OP* expr|NULLOK OP* block|NULLOK OP* cont +ApdR |OP* |newGIVENOP |NN OP* cond|NN OP* block|PADOFFSET defsv_off +ApdR |OP* |newLOGOP |I32 optype|I32 flags|NN OP *first|NN OP *other pM |LOGOP* |alloc_LOGOP |I32 type|NULLOK OP *first|NULLOK OP *other -Apda |OP* |newLOOPEX |I32 type|NN OP* label -Apda |OP* |newLOOPOP |I32 flags|I32 debuggable|NULLOK OP* expr|NULLOK OP* block -Apda |OP* |newNULLLIST -Apda |OP* |newOP |I32 optype|I32 flags +ApdR |OP* |newLOOPEX |I32 type|NN OP* label +ApdR |OP* |newLOOPOP |I32 flags|I32 debuggable|NULLOK OP* expr|NULLOK OP* block +ApdR |OP* |newNULLLIST +ApdR |OP* |newOP |I32 optype|I32 flags Ap |void |newPROG |NN OP* o -Apda |OP* |newRANGE |I32 flags|NN OP* left|NN OP* right -Apda |OP* |newSLICEOP |I32 flags|NULLOK OP* subscript|NULLOK OP* listop -Apda |OP* |newSTATEOP |I32 flags|NULLOK char* label|NULLOK OP* o +ApdR |OP* |newRANGE |I32 flags|NN OP* left|NN OP* right +ApdR |OP* |newSLICEOP |I32 flags|NULLOK OP* subscript|NULLOK OP* listop +ApdR |OP* |newSTATEOP |I32 flags|NULLOK char* label|NULLOK OP* o Apbm |CV* |newSUB |I32 floor|NULLOK OP* o|NULLOK OP* proto \ |NULLOK OP* block p |CV * |newXS_len_flags|NULLOK const char *name|STRLEN len \ @@ -1022,56 +1026,56 @@ ApM |CV * |newXS_flags |NULLOK const char *name|NN XSUBADDR_t subaddr\ Apd |CV* |newXS |NULLOK const char *name|NN XSUBADDR_t subaddr\ |NN const char *filename ApmdbR |AV* |newAV -Apa |OP* |newAVREF |NN OP* o -Apda |OP* |newBINOP |I32 type|I32 flags|NULLOK OP* first|NULLOK OP* last -Apa |OP* |newCVREF |I32 flags|NULLOK OP* o -Apda |OP* |newGVOP |I32 type|I32 flags|NN GV* gv +ApR |OP* |newAVREF |NN OP* o +ApdR |OP* |newBINOP |I32 type|I32 flags|NULLOK OP* first|NULLOK OP* last +ApR |OP* |newCVREF |I32 flags|NULLOK OP* o +ApdR |OP* |newGVOP |I32 type|I32 flags|NN GV* gv Am |GV* |newGVgen |NN const char* pack -Apa |GV* |newGVgen_flags |NN const char* pack|U32 flags -Apa |OP* |newGVREF |I32 type|NULLOK OP* o -ApaR |OP* |newHVREF |NN OP* o +ApR |GV* |newGVgen_flags |NN const char* pack|U32 flags +ApR |OP* |newGVREF |I32 type|NULLOK OP* o +ApR |OP* |newHVREF |NN OP* o ApmdbR |HV* |newHV -ApaR |HV* |newHVhv |NULLOK HV *hv -Apabm |IO* |newIO -Apda |OP* |newLISTOP |I32 type|I32 flags|NULLOK OP* first|NULLOK OP* last -AMpdan |PADNAME *|newPADNAMEouter|NN PADNAME *outer -AMpdan |PADNAME *|newPADNAMEpvn|NN const char *s|STRLEN len -AMpdan |PADNAMELIST *|newPADNAMELIST|size_t max +ApR |HV* |newHVhv |NULLOK HV *hv +ApRbm |IO* |newIO +ApdR |OP* |newLISTOP |I32 type|I32 flags|NULLOK OP* first|NULLOK OP* last +AMpdRn |PADNAME *|newPADNAMEouter|NN PADNAME *outer +AMpdRn |PADNAME *|newPADNAMEpvn|NN const char *s|STRLEN len +AMpdRn |PADNAMELIST *|newPADNAMELIST|size_t max #ifdef USE_ITHREADS -Apda |OP* |newPADOP |I32 type|I32 flags|NN SV* sv -#endif -Apda |OP* |newPMOP |I32 type|I32 flags -Apda |OP* |newPVOP |I32 type|I32 flags|NULLOK char* pv -Apa |SV* |newRV |NN SV *const sv -Apda |SV* |newRV_noinc |NN SV *const tmpRef -Apda |SV* |newSV |const STRLEN len -Apa |OP* |newSVREF |NN OP* o -Apda |OP* |newSVOP |I32 type|I32 flags|NN SV* sv +ApdR |OP* |newPADOP |I32 type|I32 flags|NN SV* sv +#endif +ApdR |OP* |newPMOP |I32 type|I32 flags +ApdR |OP* |newPVOP |I32 type|I32 flags|NULLOK char* pv +ApR |SV* |newRV |NN SV *const sv +ApdR |SV* |newRV_noinc |NN SV *const tmpRef +ApdR |SV* |newSV |const STRLEN len +ApR |OP* |newSVREF |NN OP* o +ApdR |OP* |newSVOP |I32 type|I32 flags|NN SV* sv ApdR |OP* |newDEFSVOP -pa |SV* |newSVavdefelem |NN AV *av|SSize_t ix|bool extendible -Apda |SV* |newSViv |const IV i -Apda |SV* |newSVuv |const UV u -Apda |SV* |newSVnv |const NV n -Apda |SV* |newSVpv |NULLOK const char *const s|const STRLEN len -Apda |SV* |newSVpvn |NULLOK const char *const s|const STRLEN len -Apda |SV* |newSVpvn_flags |NULLOK const char *const s|const STRLEN len|const U32 flags -Apda |SV* |newSVhek |NULLOK const HEK *const hek -Apda |SV* |newSVpvn_share |NULLOK const char* s|I32 len|U32 hash -Apda |SV* |newSVpv_share |NULLOK const char* s|U32 hash -Afpda |SV* |newSVpvf |NN const char *const pat|... -Apa |SV* |vnewSVpvf |NN const char *const pat|NULLOK va_list *const args +pR |SV* |newSVavdefelem |NN AV *av|SSize_t ix|bool extendible +ApdR |SV* |newSViv |const IV i +ApdR |SV* |newSVuv |const UV u +ApdR |SV* |newSVnv |const NV n +ApdR |SV* |newSVpv |NULLOK const char *const s|const STRLEN len +ApdR |SV* |newSVpvn |NULLOK const char *const s|const STRLEN len +ApdR |SV* |newSVpvn_flags |NULLOK const char *const s|const STRLEN len|const U32 flags +ApdR |SV* |newSVhek |NULLOK const HEK *const hek +ApdR |SV* |newSVpvn_share |NULLOK const char* s|I32 len|U32 hash +ApdR |SV* |newSVpv_share |NULLOK const char* s|U32 hash +AfpdR |SV* |newSVpvf |NN const char *const pat|... +ApR |SV* |vnewSVpvf |NN const char *const pat|NULLOK va_list *const args Apd |SV* |newSVrv |NN SV *const rv|NULLOK const char *const classname -Apda |SV* |newSVsv |NULLOK SV *const old -Apda |SV* |newSV_type |const svtype type -Apda |OP* |newUNOP |I32 type|I32 flags|NULLOK OP* first -Apda |OP* |newUNOP_AUX |I32 type|I32 flags|NULLOK OP* first \ +ApdR |SV* |newSVsv |NULLOK SV *const old +ApdR |SV* |newSV_type |const svtype type +ApdR |OP* |newUNOP |I32 type|I32 flags|NULLOK OP* first +ApdR |OP* |newUNOP_AUX |I32 type|I32 flags|NULLOK OP* first \ |NULLOK UNOP_AUX_item *aux -Apda |OP* |newWHENOP |NULLOK OP* cond|NN OP* block -Apda |OP* |newWHILEOP |I32 flags|I32 debuggable|NULLOK LOOP* loop \ +ApdR |OP* |newWHENOP |NULLOK OP* cond|NN OP* block +ApdR |OP* |newWHILEOP |I32 flags|I32 debuggable|NULLOK LOOP* loop \ |NULLOK OP* expr|NULLOK OP* block|NULLOK OP* cont \ |I32 has_my -Apda |OP* |newMETHOP |I32 type|I32 flags|NN OP* dynamic_meth -Apda |OP* |newMETHOP_named|I32 type|I32 flags|NN SV* const_meth +ApdR |OP* |newMETHOP |I32 type|I32 flags|NN OP* dynamic_meth +ApdR |OP* |newMETHOP_named|I32 type|I32 flags|NN SV* const_meth Apd |CV* |rv2cv_op_cv |NN OP *cvop|U32 flags Apd |OP* |ck_entersub_args_list|NN OP *entersubop Apd |OP* |ck_entersub_args_proto|NN OP *entersubop|NN GV *namegv|NN SV *protosv @@ -1084,7 +1088,7 @@ Apd |void |cv_set_call_checker_flags|NN CV *cv \ |NN Perl_call_checker ckfun \ |NN SV *ckobj|U32 flags Apd |void |wrap_op_checker|Optype opcode|NN Perl_check_t new_checker|NN Perl_check_t *old_checker_p -Apa |PERL_SI*|new_stackinfo|I32 stitems|I32 cxitems +ApR |PERL_SI*|new_stackinfo|I32 stitems|I32 cxitems Ap |char* |scan_vstring |NN const char *s|NN const char *const e \ |NN SV *sv Apd |const char* |scan_version |NN const char *s|NN SV *rv|bool qv @@ -1481,8 +1485,8 @@ Ein |bool |sv_only_taint_gmagic|NN SV *sv #endif : 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 +ApdbmR |SV* |sv_mortalcopy |NULLOK SV *const oldsv +XpR |SV* |sv_mortalcopy_flags|NULLOK SV *const oldsv|U32 flags ApdR |SV* |sv_newmortal Apd |SV* |sv_newref |NULLOK SV *const sv Ap |char* |sv_peek |NULLOK SV* sv @@ -1771,7 +1775,7 @@ Ap |int |get_mstats |NN perl_mstats_t *buf|int buflen|int level #endif 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 +AnpR |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) @@ -1858,7 +1862,7 @@ p |OP * |my_attrs |NN OP *o|NULLOK OP *attrs #if defined(USE_ITHREADS) ApR |PERL_CONTEXT*|cx_dup |NULLOK PERL_CONTEXT* cx|I32 ix|I32 max|NN CLONE_PARAMS* param ApR |PERL_SI*|si_dup |NULLOK PERL_SI* si|NN CLONE_PARAMS* param -Apa |ANY* |ss_dup |NN PerlInterpreter* proto_perl|NN CLONE_PARAMS* param +ApR |ANY* |ss_dup |NN PerlInterpreter* proto_perl|NN CLONE_PARAMS* param ApR |void* |any_dup |NULLOK void* v|NN const PerlInterpreter* proto_perl ApR |HE* |he_dup |NULLOK const HE* e|bool shared|NN CLONE_PARAMS* param ApR |HEK* |hek_dup |NULLOK HEK* e|NN CLONE_PARAMS* param @@ -1880,7 +1884,7 @@ ApR |SV* |sv_dup_inc |NULLOK const SV *const sstr \ Ap |void |rvpv_dup |NN SV *const dstr|NN const SV *const sstr|NN CLONE_PARAMS *const param Ap |yy_parser*|parser_dup |NULLOK const yy_parser *const proto|NN CLONE_PARAMS *const param #endif -Apa |PTR_TBL_t*|ptr_table_new +ApR |PTR_TBL_t*|ptr_table_new ApR |void* |ptr_table_fetch|NN PTR_TBL_t *const tbl|NULLOK const void *const sv Ap |void |ptr_table_store|NN PTR_TBL_t *const tbl|NULLOK const void *const oldsv \ |NN void *const newsv @@ -1946,7 +1950,7 @@ po |SV* |hfree_next_entry |NN HV *hv|NN STRLEN *indexp s |void |hsplit |NN HV *hv|STRLEN const oldsize|STRLEN newsize s |void |hfreeentries |NN HV *hv s |SV* |hv_free_ent_ret|NN HV *hv|NN HE *entry -sa |HE* |new_he +sR |HE* |new_he sanR |HEK* |save_hek_flags |NN const char *str|I32 len|U32 hash|int flags sn |void |hv_magic_check |NN HV *hv|NN bool *needs_copy|NN bool *needs_store s |void |unshare_hek_or_pvn|NULLOK const HEK* hek|NULLOK const char* str|I32 len|U32 hash @@ -2006,7 +2010,7 @@ s |bool |process_special_blocks |I32 floor \ s |void |clear_special_blocks |NN const char *const fullname\ |NN GV *const gv|NN CV *const cv #endif -Xpa |void* |Slab_Alloc |size_t sz +XpR |void* |Slab_Alloc |size_t sz Xp |void |Slab_Free |NN void *op #if defined(PERL_DEBUG_READONLY_OPS) # if defined(PERL_CORE) @@ -2693,7 +2697,7 @@ s |void |deb_stack_n |NN SV** stack_base|I32 stack_min \ #endif : pad API -Apda |PADLIST*|pad_new |int flags +ApdR |PADLIST*|pad_new |int flags #ifdef DEBUGGING pnX |void|set_padlist| NN CV * cv | NULLOK PADLIST * padlist #endif @@ -2833,7 +2837,7 @@ s |bool |ckwarn_common |U32 w Apo |bool |ckwarn |U32 w Apo |bool |ckwarn_d |U32 w : FIXME - exported for ByteLoader - public or private? -XEopMa |STRLEN *|new_warnings_bitfield|NULLOK STRLEN *buffer \ +XEopMR |STRLEN *|new_warnings_bitfield|NULLOK STRLEN *buffer \ |NN const char *const bits|STRLEN size #ifndef SPRINTF_RETURNS_STRLEN @@ -2935,7 +2939,7 @@ xpo |int |keyword_plugin_standard|NN char* keyword_ptr|STRLEN keyword_len|NN OP* # if defined(PERL_IN_SV_C) s |void |unreferenced_to_tmp_stack|NN AV *const unreferenced # endif -Aanop |CLONE_PARAMS *|clone_params_new|NN PerlInterpreter *const from \ +ARnop |CLONE_PARAMS *|clone_params_new|NN PerlInterpreter *const from \ |NN PerlInterpreter *const to Anop |void |clone_params_del|NN CLONE_PARAMS *param #endif diff --git a/proto.h b/proto.h index eb92412..fa72319 100644 --- a/proto.h +++ b/proto.h @@ -36,7 +36,6 @@ PERL_CALLCONV UV NATIVE_TO_NEED(const UV enc, const UV ch) PERL_CALLCONV const char * Perl_PerlIO_context_layers(pTHX_ const char *mode); PERL_CALLCONV void* Perl_Slab_Alloc(pTHX_ size_t sz) - __attribute__malloc__ __attribute__warn_unused_result__; PERL_CALLCONV void Perl_Slab_Free(pTHX_ void *op); @@ -1999,16 +1998,13 @@ PERL_CALLCONV int Perl_my_vsnprintf(char *buffer, const Size_t len, const char * assert(buffer); assert(format) PERL_CALLCONV OP* Perl_newANONATTRSUB(pTHX_ I32 floor, OP *proto, OP *attrs, OP *block); PERL_CALLCONV OP* Perl_newANONHASH(pTHX_ OP* o) - __attribute__malloc__ __attribute__warn_unused_result__; PERL_CALLCONV OP* Perl_newANONLIST(pTHX_ OP* o) - __attribute__malloc__ __attribute__warn_unused_result__; PERL_CALLCONV OP* Perl_newANONSUB(pTHX_ I32 floor, OP* proto, OP* block); PERL_CALLCONV OP* Perl_newASSIGNOP(pTHX_ I32 flags, OP* left, I32 optype, OP* right) - __attribute__malloc__ __attribute__warn_unused_result__; /* PERL_CALLCONV CV* newATTRSUB(pTHX_ I32 floor, OP *o, OP *proto, OP *attrs, OP *block); */ @@ -2019,17 +2015,14 @@ PERL_CALLCONV AV* Perl_newAV(pTHX) #endif PERL_CALLCONV OP* Perl_newAVREF(pTHX_ OP* o) - __attribute__malloc__ __attribute__warn_unused_result__; #define PERL_ARGS_ASSERT_NEWAVREF \ assert(o) PERL_CALLCONV OP* Perl_newBINOP(pTHX_ I32 type, I32 flags, OP* first, OP* last) - __attribute__malloc__ __attribute__warn_unused_result__; PERL_CALLCONV OP* Perl_newCONDOP(pTHX_ I32 flags, OP* first, OP* trueop, OP* falseop) - __attribute__malloc__ __attribute__warn_unused_result__; #define PERL_ARGS_ASSERT_NEWCONDOP \ assert(first) @@ -2037,7 +2030,6 @@ PERL_CALLCONV OP* Perl_newCONDOP(pTHX_ I32 flags, OP* first, OP* trueop, OP* fal PERL_CALLCONV CV* Perl_newCONSTSUB(pTHX_ HV* stash, const char* name, SV* sv); PERL_CALLCONV CV* Perl_newCONSTSUB_flags(pTHX_ HV* stash, const char* name, STRLEN len, U32 flags, SV* sv); PERL_CALLCONV OP* Perl_newCVREF(pTHX_ I32 flags, OP* o) - __attribute__malloc__ __attribute__warn_unused_result__; PERL_CALLCONV OP* Perl_newDEFSVOP(pTHX) @@ -2045,13 +2037,11 @@ PERL_CALLCONV OP* Perl_newDEFSVOP(pTHX) PERL_CALLCONV void Perl_newFORM(pTHX_ I32 floor, OP* o, OP* block); PERL_CALLCONV OP* Perl_newFOROP(pTHX_ I32 flags, OP* sv, OP* expr, OP* block, OP* cont) - __attribute__malloc__ __attribute__warn_unused_result__; #define PERL_ARGS_ASSERT_NEWFOROP \ assert(expr) PERL_CALLCONV OP* Perl_newGIVENOP(pTHX_ OP* cond, OP* block, PADOFFSET defsv_off) - __attribute__malloc__ __attribute__warn_unused_result__; #define PERL_ARGS_ASSERT_NEWGIVENOP \ assert(cond); assert(block) @@ -2060,18 +2050,15 @@ PERL_CALLCONV GP * Perl_newGP(pTHX_ GV *const gv); #define PERL_ARGS_ASSERT_NEWGP \ assert(gv) PERL_CALLCONV OP* Perl_newGVOP(pTHX_ I32 type, I32 flags, GV* gv) - __attribute__malloc__ __attribute__warn_unused_result__; #define PERL_ARGS_ASSERT_NEWGVOP \ assert(gv) PERL_CALLCONV OP* Perl_newGVREF(pTHX_ I32 type, OP* o) - __attribute__malloc__ __attribute__warn_unused_result__; /* PERL_CALLCONV GV* newGVgen(pTHX_ const char* pack); */ PERL_CALLCONV GV* Perl_newGVgen_flags(pTHX_ const char* pack, U32 flags) - __attribute__malloc__ __attribute__warn_unused_result__; #define PERL_ARGS_ASSERT_NEWGVGEN_FLAGS \ assert(pack) @@ -2082,49 +2069,40 @@ PERL_CALLCONV HV* Perl_newHV(pTHX) #endif PERL_CALLCONV OP* Perl_newHVREF(pTHX_ OP* o) - __attribute__malloc__ __attribute__warn_unused_result__; #define PERL_ARGS_ASSERT_NEWHVREF \ assert(o) PERL_CALLCONV HV* Perl_newHVhv(pTHX_ HV *hv) - __attribute__malloc__ __attribute__warn_unused_result__; #ifndef NO_MATHOMS PERL_CALLCONV IO* Perl_newIO(pTHX) - __attribute__malloc__ __attribute__warn_unused_result__; #endif PERL_CALLCONV OP* Perl_newLISTOP(pTHX_ I32 type, I32 flags, OP* first, OP* last) - __attribute__malloc__ __attribute__warn_unused_result__; PERL_CALLCONV OP* Perl_newLOGOP(pTHX_ I32 optype, I32 flags, OP *first, OP *other) - __attribute__malloc__ __attribute__warn_unused_result__; #define PERL_ARGS_ASSERT_NEWLOGOP \ assert(first); assert(other) PERL_CALLCONV OP* Perl_newLOOPEX(pTHX_ I32 type, OP* label) - __attribute__malloc__ __attribute__warn_unused_result__; #define PERL_ARGS_ASSERT_NEWLOOPEX \ assert(label) PERL_CALLCONV OP* Perl_newLOOPOP(pTHX_ I32 flags, I32 debuggable, OP* expr, OP* block) - __attribute__malloc__ __attribute__warn_unused_result__; PERL_CALLCONV OP* Perl_newMETHOP(pTHX_ I32 type, I32 flags, OP* dynamic_meth) - __attribute__malloc__ __attribute__warn_unused_result__; #define PERL_ARGS_ASSERT_NEWMETHOP \ assert(dynamic_meth) PERL_CALLCONV OP* Perl_newMETHOP_named(pTHX_ I32 type, I32 flags, SV* const_meth) - __attribute__malloc__ __attribute__warn_unused_result__; #define PERL_ARGS_ASSERT_NEWMETHOP_NAMED \ assert(const_meth) @@ -2133,64 +2111,52 @@ PERL_CALLCONV CV * Perl_newMYSUB(pTHX_ I32 floor, OP *o, OP *proto, OP *attrs, O #define PERL_ARGS_ASSERT_NEWMYSUB \ assert(o) PERL_CALLCONV OP* Perl_newNULLLIST(pTHX) - __attribute__malloc__ __attribute__warn_unused_result__; PERL_CALLCONV OP* Perl_newOP(pTHX_ I32 optype, I32 flags) - __attribute__malloc__ __attribute__warn_unused_result__; PERL_CALLCONV PADNAMELIST * Perl_newPADNAMELIST(size_t max) - __attribute__malloc__ __attribute__warn_unused_result__; PERL_CALLCONV PADNAME * Perl_newPADNAMEouter(PADNAME *outer) - __attribute__malloc__ __attribute__warn_unused_result__; #define PERL_ARGS_ASSERT_NEWPADNAMEOUTER \ assert(outer) PERL_CALLCONV PADNAME * Perl_newPADNAMEpvn(const char *s, STRLEN len) - __attribute__malloc__ __attribute__warn_unused_result__; #define PERL_ARGS_ASSERT_NEWPADNAMEPVN \ assert(s) PERL_CALLCONV OP* Perl_newPMOP(pTHX_ I32 type, I32 flags) - __attribute__malloc__ __attribute__warn_unused_result__; PERL_CALLCONV void Perl_newPROG(pTHX_ OP* o); #define PERL_ARGS_ASSERT_NEWPROG \ assert(o) PERL_CALLCONV OP* Perl_newPVOP(pTHX_ I32 type, I32 flags, char* pv) - __attribute__malloc__ __attribute__warn_unused_result__; PERL_CALLCONV OP* Perl_newRANGE(pTHX_ I32 flags, OP* left, OP* right) - __attribute__malloc__ __attribute__warn_unused_result__; #define PERL_ARGS_ASSERT_NEWRANGE \ assert(left); assert(right) PERL_CALLCONV SV* Perl_newRV(pTHX_ SV *const sv) - __attribute__malloc__ __attribute__warn_unused_result__; #define PERL_ARGS_ASSERT_NEWRV \ assert(sv) PERL_CALLCONV SV* Perl_newRV_noinc(pTHX_ SV *const tmpRef) - __attribute__malloc__ __attribute__warn_unused_result__; #define PERL_ARGS_ASSERT_NEWRV_NOINC \ assert(tmpRef) PERL_CALLCONV OP* Perl_newSLICEOP(pTHX_ I32 flags, OP* subscript, OP* listop) - __attribute__malloc__ __attribute__warn_unused_result__; PERL_CALLCONV OP* Perl_newSTATEOP(pTHX_ I32 flags, char* label, OP* o) - __attribute__malloc__ __attribute__warn_unused_result__; PERL_CALLCONV CV* Perl_newSTUB(pTHX_ GV *gv, bool fake); @@ -2200,97 +2166,77 @@ PERL_CALLCONV CV* Perl_newSTUB(pTHX_ GV *gv, bool fake); PERL_CALLCONV CV* Perl_newSUB(pTHX_ I32 floor, OP* o, OP* proto, OP* block); #endif PERL_CALLCONV SV* Perl_newSV(pTHX_ const STRLEN len) - __attribute__malloc__ __attribute__warn_unused_result__; PERL_CALLCONV OP* Perl_newSVOP(pTHX_ I32 type, I32 flags, SV* sv) - __attribute__malloc__ __attribute__warn_unused_result__; #define PERL_ARGS_ASSERT_NEWSVOP \ assert(sv) PERL_CALLCONV OP* Perl_newSVREF(pTHX_ OP* o) - __attribute__malloc__ __attribute__warn_unused_result__; #define PERL_ARGS_ASSERT_NEWSVREF \ assert(o) PERL_CALLCONV SV* Perl_newSV_type(pTHX_ const svtype type) - __attribute__malloc__ __attribute__warn_unused_result__; PERL_CALLCONV SV* Perl_newSVavdefelem(pTHX_ AV *av, SSize_t ix, bool extendible) - __attribute__malloc__ __attribute__warn_unused_result__; #define PERL_ARGS_ASSERT_NEWSVAVDEFELEM \ assert(av) PERL_CALLCONV SV* Perl_newSVhek(pTHX_ const HEK *const hek) - __attribute__malloc__ __attribute__warn_unused_result__; PERL_CALLCONV SV* Perl_newSViv(pTHX_ const IV i) - __attribute__malloc__ __attribute__warn_unused_result__; PERL_CALLCONV SV* Perl_newSVnv(pTHX_ const NV n) - __attribute__malloc__ __attribute__warn_unused_result__; PERL_CALLCONV SV* Perl_newSVpv(pTHX_ const char *const s, const STRLEN len) - __attribute__malloc__ __attribute__warn_unused_result__; PERL_CALLCONV SV* Perl_newSVpv_share(pTHX_ const char* s, U32 hash) - __attribute__malloc__ __attribute__warn_unused_result__; PERL_CALLCONV SV* Perl_newSVpvf(pTHX_ const char *const pat, ...) - __attribute__malloc__ __attribute__warn_unused_result__ __attribute__format__(__printf__,pTHX_1,pTHX_2); #define PERL_ARGS_ASSERT_NEWSVPVF \ assert(pat) PERL_CALLCONV SV* Perl_newSVpvn(pTHX_ const char *const s, const STRLEN len) - __attribute__malloc__ __attribute__warn_unused_result__; PERL_CALLCONV SV* Perl_newSVpvn_flags(pTHX_ const char *const s, const STRLEN len, const U32 flags) - __attribute__malloc__ __attribute__warn_unused_result__; PERL_CALLCONV SV* Perl_newSVpvn_share(pTHX_ const char* s, I32 len, U32 hash) - __attribute__malloc__ __attribute__warn_unused_result__; PERL_CALLCONV SV* Perl_newSVrv(pTHX_ SV *const rv, const char *const classname); #define PERL_ARGS_ASSERT_NEWSVRV \ assert(rv) PERL_CALLCONV SV* Perl_newSVsv(pTHX_ SV *const old) - __attribute__malloc__ __attribute__warn_unused_result__; PERL_CALLCONV SV* Perl_newSVuv(pTHX_ const UV u) - __attribute__malloc__ __attribute__warn_unused_result__; PERL_CALLCONV OP* Perl_newUNOP(pTHX_ I32 type, I32 flags, OP* first) - __attribute__malloc__ __attribute__warn_unused_result__; PERL_CALLCONV OP* Perl_newUNOP_AUX(pTHX_ I32 type, I32 flags, OP* first, UNOP_AUX_item *aux) - __attribute__malloc__ __attribute__warn_unused_result__; PERL_CALLCONV OP* Perl_newWHENOP(pTHX_ OP* cond, OP* block) - __attribute__malloc__ __attribute__warn_unused_result__; #define PERL_ARGS_ASSERT_NEWWHENOP \ assert(block) PERL_CALLCONV OP* Perl_newWHILEOP(pTHX_ I32 flags, I32 debuggable, LOOP* loop, OP* expr, OP* block, OP* cont, I32 has_my) - __attribute__malloc__ __attribute__warn_unused_result__; PERL_CALLCONV CV* Perl_newXS(pTHX_ const char *name, XSUBADDR_t subaddr, const char *filename); @@ -2311,14 +2257,12 @@ PERL_CALLCONV void Perl_new_ctype(pTHX_ const char* newctype); assert(newctype) PERL_CALLCONV void Perl_new_numeric(pTHX_ const char* newcoll); PERL_CALLCONV PERL_SI* Perl_new_stackinfo(pTHX_ I32 stitems, I32 cxitems) - __attribute__malloc__ __attribute__warn_unused_result__; PERL_CALLCONV SV* Perl_new_version(pTHX_ SV *ver); #define PERL_ARGS_ASSERT_NEW_VERSION \ assert(ver) PERL_CALLCONV STRLEN * Perl_new_warnings_bitfield(pTHX_ STRLEN *buffer, const char *const bits, STRLEN size) - __attribute__malloc__ __attribute__warn_unused_result__; #define PERL_ARGS_ASSERT_NEW_WARNINGS_BITFIELD \ assert(bits) @@ -2421,7 +2365,6 @@ PERL_CALLCONV void Perl_pad_fixup_inner_anons(pTHX_ PADLIST *padlist, CV *old_cv PERL_CALLCONV void Perl_pad_free(pTHX_ PADOFFSET po); PERL_CALLCONV OP * Perl_pad_leavemy(pTHX); PERL_CALLCONV PADLIST* Perl_pad_new(pTHX_ int flags) - __attribute__malloc__ __attribute__warn_unused_result__; PERL_CALLCONV void Perl_pad_push(pTHX_ PADLIST *padlist, int depth); @@ -2509,7 +2452,6 @@ PERL_CALLCONV void* Perl_ptr_table_fetch(pTHX_ PTR_TBL_t *const tbl, const void PERL_CALLCONV void Perl_ptr_table_free(pTHX_ PTR_TBL_t *const tbl); PERL_CALLCONV PTR_TBL_t* Perl_ptr_table_new(pTHX) - __attribute__malloc__ __attribute__warn_unused_result__; PERL_CALLCONV void Perl_ptr_table_split(pTHX_ PTR_TBL_t *const tbl); @@ -2547,7 +2489,6 @@ PERL_CALLCONV REGEXP* Perl_re_op_compile(pTHX_ SV ** const patternp, int pat_cou #define PERL_ARGS_ASSERT_RE_OP_COMPILE \ assert(eng) PERL_CALLCONV Malloc_t Perl_realloc(Malloc_t where, MEM_SIZE nbytes) - __attribute__malloc__ __attribute__warn_unused_result__; PERL_CALLCONV void Perl_reentrant_free(pTHX); @@ -2674,7 +2615,6 @@ PERL_CALLCONV Malloc_t Perl_safesysmalloc(MEM_SIZE nbytes) __attribute__warn_unused_result__; PERL_CALLCONV Malloc_t Perl_safesysrealloc(Malloc_t where, MEM_SIZE nbytes) - __attribute__malloc__ __attribute__warn_unused_result__; PERL_CALLCONV void Perl_save_I16(pTHX_ I16* intp); @@ -3140,12 +3080,10 @@ PERL_CALLCONV MAGIC * Perl_sv_magicext_mglob(pTHX_ SV *sv); assert(sv) #ifndef NO_MATHOMS PERL_CALLCONV SV* Perl_sv_mortalcopy(pTHX_ SV *const oldsv) - __attribute__malloc__ __attribute__warn_unused_result__; #endif PERL_CALLCONV SV* Perl_sv_mortalcopy_flags(pTHX_ SV *const oldsv, U32 flags) - __attribute__malloc__ __attribute__warn_unused_result__; PERL_CALLCONV SV* Perl_sv_newmortal(pTHX) @@ -3603,7 +3541,6 @@ PERL_CALLCONV SV* Perl_vmess(pTHX_ const char* pat, va_list* args); #define PERL_ARGS_ASSERT_VMESS \ assert(pat) PERL_CALLCONV SV* Perl_vnewSVpvf(pTHX_ const char *const pat, va_list *const args) - __attribute__malloc__ __attribute__warn_unused_result__; #define PERL_ARGS_ASSERT_VNEWSVPVF \ assert(pat) @@ -4425,7 +4362,6 @@ PERL_STATIC_NO_RET void S_hv_notallowed(pTHX_ int flags, const char *key, I32 kl assert(key); assert(msg) STATIC HE* S_new_he(pTHX) - __attribute__malloc__ __attribute__warn_unused_result__; PERL_STATIC_INLINE U32 S_ptr_hash(PTRV u); @@ -5692,7 +5628,6 @@ PERL_CALLCONV void Perl_clone_params_del(CLONE_PARAMS *param); #define PERL_ARGS_ASSERT_CLONE_PARAMS_DEL \ assert(param) PERL_CALLCONV CLONE_PARAMS * Perl_clone_params_new(PerlInterpreter *const from, PerlInterpreter *const to) - __attribute__malloc__ __attribute__warn_unused_result__; #define PERL_ARGS_ASSERT_CLONE_PARAMS_NEW \ assert(from); assert(to) @@ -5734,7 +5669,6 @@ PERL_CALLCONV struct mro_meta* Perl_mro_meta_dup(pTHX_ struct mro_meta* smeta, C #define PERL_ARGS_ASSERT_MRO_META_DUP \ assert(smeta); assert(param) PERL_CALLCONV OP* Perl_newPADOP(pTHX_ I32 type, I32 flags, SV* sv) - __attribute__malloc__ __attribute__warn_unused_result__; #define PERL_ARGS_ASSERT_NEWPADOP \ assert(sv) @@ -5775,7 +5709,6 @@ PERL_CALLCONV PERL_SI* Perl_si_dup(pTHX_ PERL_SI* si, CLONE_PARAMS* param) assert(param) PERL_CALLCONV ANY* Perl_ss_dup(pTHX_ PerlInterpreter* proto_perl, CLONE_PARAMS* param) - __attribute__malloc__ __attribute__warn_unused_result__; #define PERL_ARGS_ASSERT_SS_DUP \ assert(proto_perl); assert(param) -- 1.8.3.1