summaryrefslogtreecommitdiff
path: root/av.h
Commit message (Collapse)AuthorAgeFilesLines
* perlapi: Further clean up AV docsKarl Williamson2022-05-201-7/+9
|
* perlapi: Clean up some AV documentationKarl Williamson2022-05-201-35/+65
| | | | | | | The consolidation of newAV with newAV_alloc_xz? included nonsensical juxtapositions. This cleans that up, adds a bit of markup, moves the function implementing the newAV_alloc ones to internal, as there are no CPAN uses, and we prefer the macro interface.
* av.h: more apidoc tweaksRichard Leach2021-08-271-2/+4
|
* av.h: apidoc updates for khw commentsRichard Leach2021-08-271-7/+8
|
* av.h - addressing commentsRichard Leach2021-08-271-4/+4
|
* av.h - better document newAV_alloc_x/newAV_alloc_xzRichard Leach2021-08-271-22/+40
|
* av.h: document that backrefs lists are fake AVsRichard Leach2021-08-271-4/+5
|
* av.h: additional comments regarding real/fake AVsRichard Leach2021-08-271-5/+15
|
* av.h - document newAV_alloc_xzRichard Leach2021-07-291-0/+1
|
* Add Perl_av_new_alloc() function and newAV_alloc_x/z() macrosRichard Leach2021-05-261-0/+40
|
* style: Detabify indentation of the C code maintained by the core.Michael G. Schwern2021-01-171-1/+1
| | | | | | | | | | | This just detabifies to get rid of the mixed tab/space indentation. Applying consistent indentation and dealing with other tabs are another issue. Done with `expand -i`. * vutil.* left alone, it's part of version. * Left regen managed files alone for now.
* autodoc.pl: Specify scn for single-purpose filesKarl Williamson2020-11-061-2/+0
| | | | | | | | Many of the files in perl are for one thing only, and hence their embedded documentation will be for that one thing. By creating a hash here of them, those files don't have to worry about what section that documentation goes under, and so it can be completely changed without affecting them.
* Add POD for AvARRAY.Felipe Gasper2020-09-291-0/+6
|
* Document AvFILLp; clarify related entriesKarl Williamson2020-09-131-5/+6
|
* Reorganize perlapiKarl Williamson2020-09-041-2/+0
| | | | | This uses a new organization of sections that I came up with. I asked for comments on p5p, but there were none.
* Change some =head1 to apidoc_section linesKarl Williamson2020-09-041-1/+1
| | | | | apidoc_section is slightly favored over head1, as it is known only to autodoc, and can't be confused with real pod.
* Add av_count()Karl Williamson2020-08-191-1/+2
| | | | | | | | | This returns the number of elements in an array in a clearly named function. av_top_index(), av_tindex() are clearly named, but are less than ideal, and came about because no one back then thought of this one, until now Paul Evans did.
* Note that AvFILLp is not for public useKarl Williamson2019-09-021-0/+2
|
* Fix apidoc macro entriesKarl Williamson2019-06-251-1/+1
| | | | | | | | | | This makes various fixes to the text that is used to generate the documentation. The dominant change is to add the 'n' flag to indicate that the macro takes no arguments. A couple should have been marked with a D (for deprecated) flag, and a couple were missing parameters, and a couple were missing return values. These were spotted by using Devel::PPPort on them.
* Remove redundant info on =for apidoc linesKarl Williamson2019-05-301-1/+1
| | | | | | | | | This information is already in embed.fnc, and we know it compiles. Some of this information is now out-of-date. Get rid of it. There was one bit of information that was (apparently) wrong in embed.fnc. The apidoc line asked that there be no usage example generated for newXS. I added that flag to the embed.fnc entry.
* perlapi: AvFILL isn't deprecatedKarl Williamson2018-07-161-1/+1
| | | | See [perl #133278]
* Change av_foo_nomg() nameKarl Williamson2017-02-111-5/+3
| | | | | | | | | | | | | | | These names sparked some controversy when created: http://www.nntp.perl.org/group/perl.perl5.porters/2016/03/msg235216.html I looked through existing code for paradigms to follow, and found some occurrences of 'skip_foo_mg'. So this commit changes the names to be av_top_index_skip_len_mg() av_tindex_skip_len_mg() This is explicit about the type of magic that is ignored, and will still be valid if another type of magic ever gets added.
* Imprison at_tindex_nomg()Karl Williamson2016-03-191-1/+8
| | | | | | This name is controversial. Use #ifdef's to keep it from being exposed outside of the places that already use it. And don't publicize that it exists.
* Add av_tindex_nomg()Karl Williamson2016-03-071-0/+2
| | | | | | | This is like av_tindex, but doesn't handle magic. I'm not documenting it for now, in case it turns out this was not a good idea. Inspired from an observation by Tony Cook.
* Replace common Emacs file-local variables with dir-localsDagfinn Ilmari Mannsåker2015-03-221-6/+0
| | | | | | | | | | | | | | | | An empty cpan/.dir-locals.el stops Emacs using the core defaults for code imported from CPAN. Committer's work: To keep t/porting/cmp_version.t and t/porting/utils.t happy, $VERSION needed to be incremented in many files, including throughout dist/PathTools. perldelta entry for module updates. Add two Emacs control files to MANIFEST; re-sort MANIFEST. For: RT #124119.
* Make PADNAMELIST a separate typeFather Chrysostomos2014-11-301-2/+0
| | | | This is in preparation for making PADNAME a separate type.
* Skip trailing constants when searching padsFather Chrysostomos2013-07-301-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Under ithreads, constants and GVs are stored in the pad. When names are looked up up in a pad, the search begins at the end and works its way toward the beginning, so that an $x declared later masks one declared earlier. If there are many constants at the end of the pad, which can happen for generated code such as lib/unicore/TestProp.pl (which has about 100,000 lines and over 500,000 pad entries for constants at the end of the file scope’s pad), it can take a long time to search through them all. Before commit 325e1816, constants used &PL_sv_undef ‘names’. Since that is the default value for array elements (when viewed directly through AvARRAY, rather than av_fetch), the pad allocation code did not even bother storing the ‘name’ for these. So the name pad (aka padnamelist) was not extended, leaving just 10 entries or so in the case of lib/unicore/TestProp.pl. Commit 325e1816 make pad constants have &PL_sv_no names, so the name pad would be implicitly extended as a result of storing &PL_sv_no, causing a huge slowdown in t/re/uniprops.t (which runs lib/unicore/TestProp.pl) under threaded builds. Now, normally the name pad *does* get extended to match the pad, in pad_tidy, but that is skipped for string eval (and required file scope, of course). Hence, wrapping the contents of lib/unicore/TestProp.pl in a sub or adding ‘my $x’ to end of it will cause the same slowdown before 325e1816. lib/unicore/TestProp.pl just happened to be written (ok, generated) in such a way that it ended up with a small name pad. This commit fixes things to make them as fast as before by recording the index of the last named variable in the pad. Anything following that is disregarded in pad lookup and search begins with the last named variable. (This actually does make things faster before for subs with many trailing constants in the pad.) This is not a complete fix. Adding ‘my $x’ to the end of a large file like lib/unicore/TestProp.pl will make it just as slow again. Ultimately we need another algorithm, such as a binary search.
* Add av_tindex() synonym for av_top_index()Karl Williamson2013-02-081-0/+4
| | | | | The latter is a somewhat less clumsy name. The old one is provided a a very clear name; the new one as a somewhat slangy version
* Change name 'av_top' to 'av_top_index'Karl Williamson2013-02-081-1/+1
| | | | | | | | In using the av_top() function created in a recent commit, I found myself being confused, and thinking it meant the top element of the array, whereas it really means the index of the top element of that array. Since the new name has not appeared in a stable release, it can be changed, without remorse, to include 'index' in it.
* Add av_top() synonym for av_len()Karl Williamson2013-01-191-1/+1
| | | | av_len() is misleadingly named.
* update the editor hints for spaces, not tabsRicardo Signes2012-05-291-2/+2
| | | | | This updates the editor hints in our files for Emacs and vim to request that tabs be inserted as spaces.
* [perl #97020] Carp (actually caller) leaking memoryFather Chrysostomos2011-08-181-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Commit eff7e72c3 (Detect incomplete caller overrides in Carp) used this little trick for detecting a @DB::args that an overridden caller() failed to set: + @args = \$i; # A sentinal, which no-one else has the address of But there is a bug in caller(). The first time caller tries to write to @DB::args, it calls Perl_init_dbargs first. That function checks whether @DB::args is AvREAL, in case someone has assigned to it, and takes appropriate measures. But caller doesn’t bother calling Perl_init_dbargs more than once. So manually-assigned items in @DB::args would leak, starting with the *second* call to caller. Commit eff7e72c3 triggered that bug, resulting in a regression in Carp, in that it started leaking. eff7e72c3 was backported to 5.12.2 with commit 97705941a4, so in both 5.12 and 5.14 Carp is affected. This bug (the caller bug, not Carp’s triggering thereof) also affects any caller overrides that set @DB::args themselves, if there are alternate calls to the overridden caller and CORE::caller. This commit fixes that by changing the if (!PL_dbargs) condition in pp_caller to if (!PL_dbargs || AvREAL(PL_dbargs)). I.e., if @args is either uninitialised or AvREAL then call Perl_init_dbargs. Perl_init_dbargs also has a bug in it, that this fixes: The array not only needs AvREAL turned off, but also AvREIFY turned on, so that assignments to it that occur after its initialisation turn AvREAL back on again. (In fact, Larry Wall added a comment suggesting this back in perl 5.000.)
* perlapi.pod EnhancementsShlomi Fish2011-07-181-0/+2
| | | | | This is a patch to enhance perlapi.pod by providing Perl equivalents and clarifying documentation where appropriate.
* Remove union _xivu from struct xpvav - replace it with a non-union xav_alloc.Nicholas Clark2010-05-211-4/+2
| | | | This was the only user of xivu_p1 in union _xivu, so remove that too.
* In the SV body, exchange the positions of the NV and stash/magic.Nicholas Clark2010-05-211-2/+3
|
* Eliminate *_ALLOCATED_HEAD and *_HEAD macros which are now used only once.Nicholas Clark2009-08-221-12/+3
|
* Eliminate the remaining definitions for *_allocated structs.Nicholas Clark2009-08-221-5/+0
|
* Add MUTABLE_AV(), and remove (AV *) casts from headers.Nicholas Clark2008-10-271-2/+2
| | | p4raw-id: //depot/perl@34608
* Add a macro MUTABLE_PTR(p), which on (non-pedantic) gcc will not castNicholas Clark2008-10-271-2/+2
| | | | | | | | | | away const, returning a void *. Add MUTABLE_SV(sv) which uses this, and replace all (SV *) casts either with MUTABLE_SV(sv), or (const SV *). This probably still needs some work - assigning to SvPVX() and SvRV() is now likely to generate a casting error. The core doesn't do this. But as-is it's finding bugs that can be fixed. p4raw-id: //depot/perl@34605
* Update copyright years.Nicholas Clark2008-10-251-2/+2
| | | p4raw-id: //depot/perl@34585
* Deprecate (and remove core use of ) Nullav, Nullcv, Nullgv, Nullhe,Nicholas Clark2008-01-231-1/+5
| | | | | Nullhek and Nullhv. Nullop is going to be a bit less simple. p4raw-id: //depot/perl@33051
* factor out duplicate code in struct xpv*Marcus Holland-Moritz2007-12-301-41/+15
| | | | | Message-ID: <20071229181742.1933db40@r2d2> p4raw-id: //depot/perl@32783
* Perl_newAV() can become a mathom by making newAV() a wrapper aroundNicholas Clark2007-12-201-0/+10
| | | | | newSV_type() and tweaking Perl_sv_upgrade(). p4raw-id: //depot/perl@32675
* Update copyright years to include 2007. (Plus a couple of 2006s andNicholas Clark2007-01-021-1/+1
| | | | | earlier we missed in av.h and hv.h) p4raw-id: //depot/perl@29670
* Remove the vestigal "#if 0"s from header files that defined same-sizedNicholas Clark2007-01-021-4/+0
| | | | | *allocated structs, as these are not going to be needed again. p4raw-id: //depot/perl@29664
* Move all the FBM data fields from the table into a struct xbm_s whichNicholas Clark2006-12-281-0/+5
| | | | | is part of the xnv union. p4raw-id: //depot/perl@29634
* Move the low/high cop sequences from NVX/IVX to a two U32 structureNicholas Clark2006-12-281-0/+4
| | | | | | in the xnv union. This frees up IVX for the PL_generation code, which in turn will allow SvCUR to return to its real purpose. p4raw-id: //depot/perl@29630
* Move the GvNAME HEK into the IV union - every GV is now 1 pointerNicholas Clark2006-03-051-0/+4
| | | | | smaller. p4raw-id: //depot/perl@27380
* xgv_stash can be stored as a union with the NV, reducing the size ofNicholas Clark2006-02-251-1/+4
| | | | | PVGVs by another pointer. p4raw-id: //depot/perl@27326
* Store the stash for our in the magic slot. This will allow us to useNicholas Clark2006-02-241-2/+8
| | | | | | PVMGs in pad names where previously PVGVs were used. In turn, this gives much greater flexibility for the layout of PVGVs. p4raw-id: //depot/perl@27312