summaryrefslogtreecommitdiff
path: root/dist/constant
Commit message (Collapse)AuthorAgeFilesLines
* Increase $constant::VERSION to 1.31Father Chrysostomos2013-12-261-1/+1
|
* Remove constant.pm-specific behaviour from Internals::SvREADONLYFather Chrysostomos2013-12-261-3/+3
| | | | | | | Some stuff on CPAN is using this undocumented function, so give constant.pm its own. It is already a core module, depending on functionality provided by the core solely for its sake; so this does not really change its relationship to the core.
* Increase $constant::VERSION to 1.30Father Chrysostomos2013-11-301-1/+1
|
* constant.pm: Make elements of list consts read-onlyFather Chrysostomos2013-11-301-2/+1
| | | | | | | | | | | | | Now that Internals::SvREADONLY turns on the PADTMP flag for all the elements, the read-only flag on the elements themselves will not actually make the returned elements read-only, because PADTMPs get copied in all cases where readonliness matters. What this does is prevent the original SV from being modified, allowing for more opti- misations in perl’s internals (e.g., string buffers being stolen from PADTMPs not marked read-only). The order of the statements needs to be rearranged, otherwise we end up setting the flag on a temporary copy of each element due to ‘for’.
* constant.pm: Consistent spaces after dots in podFather Chrysostomos2013-11-141-8/+8
| | | | It was inconsistent throughout.
* Increase $constant::VERSION to 1.29Father Chrysostomos2013-11-141-1/+1
|
* constant.pm: Note that list constants are notFather Chrysostomos2013-08-121-0/+2
|
* Don’t let list const modification affect future retvalsFather Chrysostomos2013-08-041-2/+14
| | | | | | | | | | | In commit f99a5f08f203, I inadvertently made modifications to val- ues return by list ‘constants’ affect what values are returned sub- sequently. It’s for this type of situation that PADTMP exists (values are never referenced, but copied). So use it. This is similar to 5608dcc62, which fixed #3105.
* [perl #119045] Make list constant mutable againFather Chrysostomos2013-07-282-1/+3
| | | | This broke CPAN. Maybe we need to rethink this....
* Version number tweaks in tests and other cleanupFather Chrysostomos2013-07-252-9/+6
| | | | | | | I didn’t have this constant stuff ready as soon as I expected. I also left a comment and a couple of ‘local $TODO’s lying around that don’t need to be there. As a bonus, correct a typo in constant.pm’s docu- mentation.
* Update constant.pm to reflect list inlinementFather Chrysostomos2013-07-251-2/+1
| | | | | | | | I also removed ‘some symbols may be redefined without generating a warning’. I know not to what it refers. It has been there as long as constant.pm has. If a constant is clobbered by another constant with the same value, there is no warning, as it is harmless. That may be to what it refers, but we don’t need a caveat for that.
* constant.pm: Make list constants read-onlyFather Chrysostomos2013-07-252-2/+16
| | | | | | Here we take advantage of the array-ref-stash-elem mechanism added in the previous commit, which causes the actual elements of the stored array to be pushed on to the stack.
* Increase $constant::VERSION to 1.28Father Chrysostomos2013-07-251-1/+1
|
* Stop constant.pm from (ab)using subs for scalarsFather Chrysostomos2013-07-251-9/+25
| | | | | | | | under versions that support $::{foo} = \1. This changes no behaviour. Future commits will change the way sub(){42} and sub(){$forty_two} work. (The former will return a muta- ble value; the latter will not be inlined at all.)
* constant.t: Correct versionFather Chrysostomos2013-07-251-2/+2
| | | | I didn’t have this done in time for 5.19.1.
* op.c: Stop copying constants under ithreadsFather Chrysostomos2013-07-251-2/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This fixes bugs #21979, #89188, #109746, #114838 and #115388 and mostly fixes #109744 and #105906 (other issues still remain in those two tickets). Because the PADTMP flag was doing double duty, indicating that a pad slot was in use in addition to indicating a target, constants could not be shared between pad slots, as freeing one const op (and turning of its PADTMP flag in pad_free) would mark some other pad slot as free. I believe this may have been fixed already by change 3b1c21fabed, which made const ops use pad_swipe (which removes the SV from the pad) instead of pad_free (which marks it as available for reuse). But the copying still happens. In any case, as of the previous commit, whether a pad slot for a con- stant is in use is now stored in the pad name. Slots in use for const ops now have &PL_sv_no names. So there is no longer any reason to copy the constants. The difference can be observed thus: Before: $ ./perl -lIlib -MDevel::Peek -e 'sub foo(){42} Dump foo; Dump foo' SV = IV(0x7f94ea02ef10) at 0x7f94ea02ef20 REFCNT = 2 FLAGS = (PADTMP,IOK,READONLY,pIOK) IV = 42 SV = IV(0x7f94ea02eeb0) at 0x7f94ea02eec0 REFCNT = 1 FLAGS = (PADTMP,IOK,READONLY,pIOK) IV = 42 After: $ ./perl -lIlib -MDevel::Peek -e 'sub foo(){42} Dump foo; Dump foo' SV = IV(0x7f894882ef10) at 0x7f894882ef20 REFCNT = 3 FLAGS = (IOK,READONLY,pIOK) IV = 42 SV = IV(0x7f894882ef10) at 0x7f894882ef20 REFCNT = 3 FLAGS = (IOK,READONLY,pIOK) IV = 42 Notice the different addresses. There are still special cases for copying &PL_sv_undef, which I need to tackle. Since most constants created by ‘use constant’ have the PADMY flag on (since they reside in lexical variables inside constant.pm) and PADMY and PADTMP are exclusive, I have stop turning on PADTMP for constants. It is no longer necessary now, since before its purpose was to mark pad entries as being in use. That means many to-do tests pass.
* Test (im)mutability of constants and constant-like subsFather Chrysostomos2013-07-251-1/+62
| | | | including many to-do tests
* Make utf8 downgrading in constant.pm, version dependentBrad Gilbert2013-03-201-12/+3
| | | | | | The reason for this change is that the test that determines when to do this caused the utf8 module to always be loaded.
* constant.pm: Rmv ref in pod to non-existent moduleKarl Williamson2013-03-181-4/+1
|
* Remove checks for Perl 5.6; adjust tests; bump version number.James E Keenan2013-01-182-7/+5
| | | | | | | | | | | | | | | | | | Patch contributed by Sébastien Aperghis-Tramoni For: RT #114770. # Please enter the commit message for your changes. Lines starting # with '#' will be ignored, and an empty message aborts the commit. # On branch blead # Your branch is ahead of 'origin/blead' by 1 commit. # # Changes to be committed: # (use "git reset HEAD^1 <file>..." to unstage) # # modified: dist/constant/lib/constant.pm # modified: dist/constant/t/constant.t #
* dist/constant/t/utf8.t: Skip tests for early PerlsSébastien Aperghis-Tramoni2012-12-051-1/+7
|
* Make dual-lived constant.pm work on 5.8 againSébastien Aperghis-Tramoni2012-09-041-3/+2
| | | | | | | | | | | | | | Before releasing the version of constant.pm from bleadperl to the CPAN, I tested it with the versions of Perl I have by hand, and it appears that the current code fails to compile on 5.8: Bareword "_DOWNGRADE" not allowed while "strict subs" in use at lib/constant.pm line 142. Added by bd8cb5529605f33aa9cf95d6c471386b3a0e015d Removing the short-circuit return allows the code to compile and the tests to pass on all stable Perl from 5.8.2 to 5.16.1.
* Increase $constant::VERSION from 1.22 to 1.23Father Chrysostomos2011-10-061-1/+1
|
* constant.pm: Disable the UTF8 downgrade when unnecessaryFather Chrysostomos2011-10-061-4/+19
| | | | | | The downgrade bug that constant.pm has to imitate is about to be fixed in the next commit. The bug workaround is itself a bug if the bug it is trying to work around is not present.
* Revert "Revert "Missing bug number in d12b49d""Father Chrysostomos2011-05-201-1/+1
| | | | This reverts commit d33333ec9850d2a0f2f5466e207dcc612dc4dc31.
* Increase constant’s versionFather Chrysostomos2011-05-201-1/+1
| | | | in preparation for the next commit
* Revert "Missing bug number in d12b49d"Father Chrysostomos2011-04-191-1/+1
| | | | | | | This reverts commit 53777b0ce48433ad582498a56c60698a8fad29f6. constant.pm 1.21 has already been released on CPAN. Reverting this for now just keeps things simple.
* Missing bug number in d12b49dFather Chrysostomos2011-04-191-1/+1
|
* Make Unicode constants under use utf8 work againFather Chrysostomos2011-04-172-1/+19
| | | | | | Because sub lookup (and glob lookup in general) ignores the UTF8 flag, such subs are actually ‘correctly’ stored under the utf8-encoded equivalent of the name, and not the name itself.
* Move test for #76540 to op/gv.tFlorian Ragwitz2010-09-081-14/+1
| | | | | | | | | Commit e5c69c9b added the test to dist/constant/t/constant.t, probably because the bug was initially reported in combination with constant.pm. However, it was a core bug in gv_init and can be reproduced easily without constant.pm. With this change dist/constant can be safely synced back to CPAN without having to SKIP or TODO this particular test.
* [perl #76540] "print CONSTANT," gives double-freeDavid Mitchell2010-07-241-1/+14
| | | | | | | | | gv_init() has name and len args, but newCONSTSUB() (which it calls) doesn't have a len arg, so any trailing garbage in name gets used by newCONSTSUB. In the test case, this means that we end up attaching the const CV to both the "FOO" and qq{FOO, "\\n";\n} GVs. So it gets freed twice.
* [perl #68640] Wrong error for undef constant nameZefram2009-12-152-7/+12
|
* Move constant from ext/ to dist/Nicholas Clark2009-09-292-0/+735