summaryrefslogtreecommitdiff
path: root/mathoms.c
Commit message (Collapse)AuthorAgeFilesLines
* embed.fnc, mathoms.c: Add commentsKarl Williamson2012-11-281-0/+2
|
* Remove "register" declarationsKarl Williamson2012-11-241-43/+43
| | | | | | | This finishes the removal of register declarations started by eb578fdb5569b91c28466a4d1939e381ff6ceaf4. It neglected the ones in function parameter declarations, and didn't include things in dist, ext, and lib, which this does include
* [perl #115440] Fix various leaks with fatal FETCHFather Chrysostomos2012-10-251-2/+4
| | | | | | | | | | | | | Various pieces of code were creating an SV and then assigning to it from a value that might be magical. If the source scalar is magical, it could die when magic is called, leaking the scalar that would have been assigned to. So we call get-magic before creating the new scalar, and then use a non-magical assignment. Also, anonhash and anonlist were doing nothing to protect the aggre- gate if an argument should die on FETCH, resulting in a leak.
* Perl_sv_mortalcopy expects a return value.Craig A. Berry2012-10-071-1/+1
| | | | | | | | | Courtesy of the OpenVMS C compiler, which said: SV * ^ %CC-I-MISSINGRETURN, Non-void function "Perl_sv_mortalcopy" does not contain a return statement. at line number 1206 in file D0:[craig.blead]mathoms.c;1
* [perl #79824] Don’t cow for sv_mortalcopy call from XSFather Chrysostomos2012-10-051-0/+7
| | | | | | | | XS code doing sv_mortalcopy(sv) will expect to get a true copy, and not a COW ‘copy’. So make sv_mortalcopy and wrapper around the new sv_mortalcopy_flags that passes it SV_DO_COW_SVSETSV, which is defined as 0 for XS code.
* Omnibus removal of register declarationsKarl Williamson2012-08-181-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This removes most register declarations in C code (and accompanying documentation) in the Perl core. Retained are those in the ext directory, Configure, and those that are associated with assembly language. See: http://stackoverflow.com/questions/314994/whats-a-good-example-of-register-variable-usage-in-c which says, in part: There is no good example of register usage when using modern compilers (read: last 10+ years) because it almost never does any good and can do some bad. When you use register, you are telling the compiler "I know how to optimize my code better than you do" which is almost never the case. One of three things can happen when you use register: The compiler ignores it, this is most likely. In this case the only harm is that you cannot take the address of the variable in the code. The compiler honors your request and as a result the code runs slower. The compiler honors your request and the code runs faster, this is the least likely scenario. Even if one compiler produces better code when you use register, there is no reason to believe another will do the same. If you have some critical code that the compiler is not optimizing well enough your best bet is probably to use assembler for that part anyway but of course do the appropriate profiling to verify the generated code is really a problem first.
* 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.
* Use the (START|END)_EXTERN_C macros.Craig A. Berry2012-05-241-6/+2
| | | | We seem to use them everywhere else in core.
* Unmangle mathoms under C++.Craig A. Berry2012-05-241-0/+11
| | | | | | | In order to actually provide binary compatibility, we have to serve up these functions under the names they were known by before making their way into mathoms.c. We've always done that under C, but not C++.
* Bump several file copyright datesSteffen Schwigon2012-01-191-1/+2
| | | | | | | Sync copyright dates with actual changes according to git history. [Plus run regen_perly.h to update the SHA-256 checksums, and regen/regcharclass.pl to update regcharclass.h]
* need backwards-compatile to_utf8_foo()Karl Williamson2012-01-081-0/+37
| | | | | | | | | | These 4 functions have been replaced by variants to_utf8_foo_flags(), but for XS code that called the old ones in the Perl_to_utf8_foo() forms, backwards compatibility versions need to be created. For calls of just the to_utf8_foo() forms, macros have been used to automatically call the new forms without the performance penalty of going through the compatibility functions.
* do_exec needs no compatibility version in mathoms.c as it's not in the API.Nicholas Clark2011-07-241-11/+0
| | | | | | | | | 9555a685dbd794b0 replaced it with a macro and added the full-name version in mathoms.c to retain compatibility with any program whose source code uses the full name. However, as do_exec was never in the API, no program would be using it. (It's also unconditionally explicitly not exported on various platforms including Win32. Google Codesearch and grep.cpan.me find no users of it outside the core.)
* More apidoc entries need \n\n before =cutFather Chrysostomos2011-07-161-0/+2
|
* mathoms.c: pod: fix broken linkKarl Williamson2011-05-181-1/+1
|
* Protect sv_collxfrm in mathoms.c with a USE_LOCALE_COLLATE ifdefDavid Leadbeater2011-03-281-0/+2
| | | | | It calls sv_collxfrm_flags which is only defined if USE_LOCALE_COLLATE is set.
* Replace OP stubs in mathoms.c with #define aliases in opcode.hNicholas Clark2011-01-091-438/+0
| | | | | | | External code that references OPs by name will still link (and work). Unlike the other compatibility functions in mathoms.c, the OP stubs were simply making calls onwards to their replacements, so simply taking up space without adding anything.
* Merge the opcode bodies for pp_bind and pp_connect.Nicholas Clark2010-12-301-0/+5
|
* Merge the opcode bodies for chop/chomp and schop/schomp.Nicholas Clark2010-12-271-0/+10
|
* Convert newSUB() to a macro wrapping Perl_newATTRSUB()Nicholas Clark2010-11-171-0/+7
| | | | | Provide a Perl_newSUB() function in mathoms.c for anyone referencing it by its full name.
* Document the new custom op functions.Ben Morrow2010-11-141-0/+14
|
* Improve custom OP support.Ben Morrow2010-11-141-0/+14
| | | | | | | | | | | | | | | | | Change the custom op registrations from two separate hashes to one hash holding structure pointers, and add API functions to register ops and look them up. This will make it easier to add new properties of custom ops in the future. Copy entries across from the old hashes where necessary, to preserve compatibility. Add two new properties, in addition to the already-existing 'name' and 'description': 'class' and 'peep'. 'class' is one of the OA_*OP constants, and allows B and other introspection mechanisms to work with custom ops that aren't BASEOPs. 'peep' is a pointer to a function that will be called for ops of this type from Perl_rpeep. Adjust B.xs to take account of the new properties, and also to give custom ops their registered name rather than simply 'custom'.
* mro_isa_changed_in3 is no longer necessaryFather Chrysostomos2010-11-111-7/+0
| | | | | | | | as of 80ebaca. It was nice while it lasted. This reverts 6f86b615fa.
* ANSI C-ify the Perl_mro_isa_changed_in return mathoms.cTony Cook2010-10-131-1/+1
| | | | | | | | A return statement with an expression shall not appear in a function whose return type is void. See http://source.test-smoke.org/tsdb?mode=report&rid=86779&top=86781 for an example build failure.
* Correct prototype of mathom Perl_mro_isa_changed_in() for ithreads.Nicholas Clark2010-10-111-1/+1
| | | | 6f86b615fa775fad forgot the pTHX_
* Allow mro_isa_changed_in to be called on nonexistent packagesFather Chrysostomos2010-10-111-0/+7
| | | | | | | | | | | | | | | | | This is necessary for an upcoming bug fix. (For this bug: @left::ISA = 'outer::inner'; @right::ISA = 'clone::inner'; *clone:: = \%outer::; print left->isa('clone::inner'),"\n"; print right->isa('outer::inner'),"\n"; ) This commit actually replaces mro_isa_changed_in with mro_isa_changed_in3. See the docs for it in the diff for mro.c.
* [perl #76814] FETCH called twice - !Father Chrysostomos2010-09-241-0/+7
| | | | | | This fixes ! by changing sv_2bool to sv_2bool_flags (with a macro wrapper) and adding SvTRUE_nomg. It also corrects the docs that state incorrectly that SvTRUE does not handle magic.
* [perl #76814] FETCH called twice - string comparison opsFather Chrysostomos2010-09-241-0/+14
| | | | | | This patch changes sv_eq, sv_cmp, sv_cmp_locale and sv_collxfrm to _flags forms, with macros under the old names for sv_eq and sv_collxfrm, but functions for sv_cmp* since pp_sort.c needs them.
* add my_[l]stat_flags(); make my_[l]stat() mathomsDavid Mitchell2010-07-031-0/+14
| | | | | | | my_stat() and my_lstat() call get magic on the stack arg, so create _flags() variants that allow us to control this. (I can't just change the signature or the mg_get() behaviour since my_[l]stat() are listed as being in the public API, even though they're undocumented.)
* Return DIE(...) to *return*ing Perl_die(...).Nicholas Clark2010-06-271-2/+0
| | | | | | | | | Much simplification ensues - witness the diffstat. Changes Perl_die_unwind() to use Perl_croak() rather than DIE(). Reverses an unwise part of bb4c52e023e0fcad. Reverts 9e95c6350a60744d and 805bf316c58ab2d7.
* Fix the regexp in t/porting/args_assert.t, and add 3 missing macros.Nicholas Clark2010-05-291-0/+1
| | | | Resolves RT #72800.
* add flags arg to sv_2nv (as sv_2nv_flags)David Mitchell2010-05-081-0/+12
|
* On the save stack, store the save type as the bottom 6 bits of a UV.Nicholas Clark2010-05-011-4/+4
| | | | This makes the other 26 (or 58) bits available for save data.
* move JMPENV_JUMP to die_where and mark it as "noreturn"Gerard Goossen2009-11-061-0/+2
|
* Merge gv_IOadd() into gv_add_by_type().Nicholas Clark2009-08-081-6/+6
|
* Perl_newIO() can become a mathom by making newIO() a wrapper around newSV_type()Nicholas Clark2009-08-081-0/+7
| | | | and tweaking Perl_sv_upgrade().
* Merge gv_AVadd(), gv_HVadd() and gv_SVadd() into gv_add_by_type().Nicholas Clark2009-08-081-0/+26
| | | | The "short" names become macro wrappers, and the Perl_* versions become mathoms.
* Avoid warnings from exacting C compilers when -DNO_MATHOMS is in force.Nicholas Clark2008-12-021-1/+7
| | | p4raw-id: //depot/perl@34977
* Convert all the scope save functions of the formNicholas Clark2008-11-301-0/+38
| | | | | | | | | SSCHECK(2); SSPUSHPTR(o); SSPUSHINT(SAVEt_FREEOP); into a single function Perl_save_pushptr(ptr, type), which the others call. Implement the others as macros. This reduces the object code size. p4raw-id: //depot/perl@34956
* av_fake() isn't in the public API, and isn't used anywhere, so it canNicholas Clark2008-11-271-23/+0
| | | | | go. p4raw-id: //depot/perl@34944
* Perl_oopsCV() is not part of the public API, not used anywhere, so canNicholas Clark2008-11-261-11/+0
| | | | | go. p4raw-id: //depot/perl@34937
* Perl_cv_ckproto() is not part of the public API, and not used anywhereNicholas Clark2008-11-261-8/+0
| | | | | in the core. So it can go. p4raw-id: //depot/perl@34922
* PATCH: Large omnibus patch to clean up the JRRT quotesTom Christiansen2008-11-021-4/+6
| | | | | | Message-ID: <25940.1225611819@chthon> Date: Sun, 02 Nov 2008 01:43:39 -0600 p4raw-id: //depot/perl@34698
* Eliminate (SV *) casts from the rest of *.c, picking up one (further)Nicholas Clark2008-10-301-5/+5
| | | | | erroneous const in dump.c. p4raw-id: //depot/perl@34675
* Eliminate (AV *) casts in *.c.Nicholas Clark2008-10-291-2/+2
| | | p4raw-id: //depot/perl@34650
* Every remaining (HV *) cast in *.cNicholas Clark2008-10-281-1/+1
| | | p4raw-id: //depot/perl@34629
* Update copyright years.Nicholas Clark2008-10-251-1/+1
| | | p4raw-id: //depot/perl@34585
* Define sv_insert() as a wrapper to sv_insert_flags(), and moveNicholas Clark2008-04-011-0/+8
| | | | | Perl_sv_insert() to mathoms.c p4raw-id: //depot/perl@33627
* assert() that every NN argument is not NULL. Otherwise we have theNicholas Clark2008-02-121-0/+123
| | | | | | | | | | | | ability to create landmines that will explode under someone in the future when they upgrade their compiler to one with better optimisation. We've already done this at least twice. (Yes, some of the assertions are after code that would already have SEGVd because it already deferences a pointer, but they are put in to make it easier to automate checking that each and every case is covered.) Add a tool, checkARGS_ASSERT.pl, to check that every case is covered. p4raw-id: //depot/perl@33291
* As Perl_magic_setbm() and Perl_magic_setfm() aren't in the public API,Nicholas Clark2007-12-311-12/+0
| | | | | they can just go. p4raw-id: //depot/perl@32790
* Perl_magic_setbm() and Perl_magic_setfm() are mathoms that can beNicholas Clark2007-12-311-0/+12
| | | | | | | merged with Perl_magic_setregexp(). [Coverage on the testsuite suggests that more than that they're actually dead code, but in theory it should be possible to construct a test case that exercises them.] p4raw-id: //depot/perl@32789