]> git.vpit.fr Git - perl/modules/Variable-Magic.git/log
perl/modules/Variable-Magic.git
11 years agoDon't use the main:: stash in the last test of t/17-ctl.t rt77991
Vincent Pit [Sun, 24 Jun 2012 22:50:26 +0000 (00:50 +0200)]
Don't use the main:: stash in the last test of t/17-ctl.t

As it is less subject to extra lookups.

This fixes RT #77991 in a better way.

11 years agoConsistently format magic types with I<>
Vincent Pit [Sun, 24 Jun 2012 22:30:12 +0000 (00:30 +0200)]
Consistently format magic types with I<>

11 years agoRemove a couple of commented asserts
Vincent Pit [Sun, 24 Jun 2012 22:08:08 +0000 (00:08 +0200)]
Remove a couple of commented asserts

11 years agoLeak less memory when an exception is thrown from a free callback
Vincent Pit [Sun, 24 Jun 2012 22:07:45 +0000 (00:07 +0200)]
Leak less memory when an exception is thrown from a free callback

11 years agoMove the global destruction logic of t/15-self.t out in an helper module
Vincent Pit [Sun, 24 Jun 2012 21:45:52 +0000 (23:45 +0200)]
Move the global destruction logic of t/15-self.t out in an helper module

11 years agoLower t/17-ctl.t's last test expectations
Vincent Pit [Sun, 24 Jun 2012 19:19:50 +0000 (21:19 +0200)]
Lower t/17-ctl.t's last test expectations

With ActivePerl, there's only one line produced by this test because of
some strange interference between local *_, loading Exporter.pm and
compiling '-d _'. Since this test has also been broken recently by a
change in the core, it is more reliable to stop asking for the exact
count of matches.

This fixes RT #77991.

11 years agoDon't leak vtables and wizards freed during global destruction
Vincent Pit [Sat, 23 Jun 2012 21:39:11 +0000 (23:39 +0200)]
Don't leak vtables and wizards freed during global destruction

At this time, we cannot access the callbacks, but we are still allowed
to call Safefree() and PerlMemShared_free().

11 years agoCleaner version numbers
Vincent Pit [Sat, 23 Jun 2012 21:20:48 +0000 (23:20 +0200)]
Cleaner version numbers

11 years agoRemove one extra mention to MGf_COPY
Vincent Pit [Sat, 23 Jun 2012 21:16:51 +0000 (23:16 +0200)]
Remove one extra mention to MGf_COPY

Also explicitely state from which perl versions the MGf_* constants are
available.

11 years agoJumbo POD overhaul
Vincent Pit [Sat, 23 Jun 2012 20:02:16 +0000 (22:02 +0200)]
Jumbo POD overhaul

Lots of rewordings and clarifications.

11 years agoTeach t/35-stash.t about perl 5.17.1
Vincent Pit [Thu, 21 Jun 2012 16:50:19 +0000 (18:50 +0200)]
Teach t/35-stash.t about perl 5.17.1

11 years agoThis is 0.49 v0.49
Vincent Pit [Tue, 5 Jun 2012 21:39:00 +0000 (23:39 +0200)]
This is 0.49

11 years agoTeach t/17-ctl.t about perl 5.17.0
Vincent Pit [Tue, 5 Jun 2012 21:06:47 +0000 (23:06 +0200)]
Teach t/17-ctl.t about perl 5.17.0

11 years agoReuse the diag() helper in the TestThreads module
Vincent Pit [Sun, 6 May 2012 13:16:42 +0000 (15:16 +0200)]
Reuse the diag() helper in the TestThreads module

12 years agoRequire Module::ExtractUse 0.24 for the Kwalitee test
Vincent Pit [Sun, 19 Feb 2012 13:09:03 +0000 (14:09 +0100)]
Require Module::ExtractUse 0.24 for the Kwalitee test

12 years agoThis is 0.48 v0.48
Vincent Pit [Fri, 17 Feb 2012 23:38:07 +0000 (00:38 +0100)]
This is 0.48

12 years agoDecorate the magic callbacks section
Vincent Pit [Fri, 17 Feb 2012 18:46:50 +0000 (19:46 +0100)]
Decorate the magic callbacks section

12 years agoRemove an useless #define wrap
Vincent Pit [Fri, 17 Feb 2012 18:41:00 +0000 (19:41 +0100)]
Remove an useless #define wrap

12 years agoBump copyright year
Vincent Pit [Fri, 17 Feb 2012 18:16:42 +0000 (19:16 +0100)]
Bump copyright year

12 years agoAllow passing ref-to-undef as callbacks to install a noop callback
Vincent Pit [Fri, 17 Feb 2012 18:16:16 +0000 (19:16 +0100)]
Allow passing ref-to-undef as callbacks to install a noop callback

12 years agoIn t/22-len.t, localize the wizard for strings to the SKIP block
Vincent Pit [Fri, 17 Feb 2012 18:15:35 +0000 (19:15 +0100)]
In t/22-len.t, localize the wizard for strings to the SKIP block

12 years agoMove the sv length logic into a new vmg_sv_len() function
Vincent Pit [Thu, 16 Feb 2012 22:51:02 +0000 (23:51 +0100)]
Move the sv length logic into a new vmg_sv_len() function

12 years agoProtect $@ inside Variable::Magic::TestWatcher::init_watcher
Vincent Pit [Thu, 16 Feb 2012 22:11:20 +0000 (23:11 +0100)]
Protect $@ inside Variable::Magic::TestWatcher::init_watcher

12 years agoTest that unqualified sub names as callbacks default to the current package
Vincent Pit [Thu, 16 Feb 2012 21:58:25 +0000 (22:58 +0100)]
Test that unqualified sub names as callbacks default to the current package

12 years agoThis is 0.47 v0.47
Vincent Pit [Thu, 27 Oct 2011 16:52:15 +0000 (18:52 +0200)]
This is 0.47

12 years agoTest 'delete' uvar magic and introduce VMG_COMPAT_HASH_DELETE_NOUVAR_VOID
Vincent Pit [Wed, 26 Oct 2011 22:10:15 +0000 (00:10 +0200)]
Test 'delete' uvar magic and introduce VMG_COMPAT_HASH_DELETE_NOUVAR_VOID

12 years ago'store' and 'delete' uvar magics don't need the uvar/clear hack
Vincent Pit [Wed, 26 Oct 2011 21:33:18 +0000 (23:33 +0200)]
'store' and 'delete' uvar magics don't need the uvar/clear hack

12 years agoClean up vmg_uvar_val() a bit
Vincent Pit [Wed, 26 Oct 2011 20:57:54 +0000 (22:57 +0200)]
Clean up vmg_uvar_val() a bit

12 years agoMinimize the accesses to the optree during the uvar/clear hack
Vincent Pit [Wed, 26 Oct 2011 20:43:38 +0000 (22:43 +0200)]
Minimize the accesses to the optree during the uvar/clear hack

12 years agoPrettify the declaration of vmg_svt_copy()
Vincent Pit [Wed, 26 Oct 2011 19:56:42 +0000 (21:56 +0200)]
Prettify the declaration of vmg_svt_copy()

12 years agovmg_cast() should set mg_flags according to the vtable
Vincent Pit [Wed, 26 Oct 2011 19:56:15 +0000 (21:56 +0200)]
vmg_cast() should set mg_flags according to the vtable

And not according to the Perl callbacks.

12 years agoMake the watch { } wrapper properly apply context
Vincent Pit [Wed, 26 Oct 2011 18:45:00 +0000 (20:45 +0200)]
Make the watch { } wrapper properly apply context

12 years agoThe magic signatures are no longer needed
Vincent Pit [Wed, 26 Oct 2011 17:26:26 +0000 (19:26 +0200)]
The magic signatures are no longer needed

12 years agoEnforce saner checks on wizard SVs and MAGIC tokens
Vincent Pit [Wed, 26 Oct 2011 17:22:13 +0000 (19:22 +0200)]
Enforce saner checks on wizard SVs and MAGIC tokens

This commit adds a variety of helper functions that extract the vmg_wizard
object from a SV or a MAGIC token. Version with (for direct interaction
with the user) and without checks (for magic callbacks, where we know the
MAGIC token is already valid) are provided.

12 years agoReorder some code
Vincent Pit [Wed, 26 Oct 2011 15:57:32 +0000 (17:57 +0200)]
Reorder some code

12 years agoRename vmg_wizard_* to vmg_wizard_sv_* and {MGWIZ,mgwiz}_* to vmg_wizard_*
Vincent Pit [Wed, 26 Oct 2011 15:50:13 +0000 (17:50 +0200)]
Rename vmg_wizard_* to vmg_wizard_sv_* and {MGWIZ,mgwiz}_* to vmg_wizard_*

12 years agoClone wizard objects through dup magic
Vincent Pit [Wed, 26 Oct 2011 14:52:27 +0000 (16:52 +0200)]
Clone wizard objects through dup magic

ptable.h is no longer needed.

12 years agoClean up threads tests a bit
Vincent Pit [Wed, 26 Oct 2011 14:12:20 +0000 (16:12 +0200)]
Clean up threads tests a bit

12 years agoShare the vtables with threaded perls
Vincent Pit [Wed, 26 Oct 2011 13:37:55 +0000 (15:37 +0200)]
Share the vtables with threaded perls

When a magical variable is cloned into a new thread, the associated vtables
aren't cloned by mg_dup(), but simply shared. This means that if a wizard
is casted upon a variable in the main interpreter, then a thread is created,
then the wizard is destroyed, and then the cloned variant of the magical
variable is manipulated, perl can no longer access the vtable (it was freed
when the wizard was destroyed) and memory misreads happen.

To solve this, the only solution is to make the vtables associated with
wizards shared and reference-counted.

12 years agoWrap MUTEX_{LOCK,UNLOCK} in macros so can we don't have to #ifdef them
Vincent Pit [Wed, 26 Oct 2011 10:02:11 +0000 (12:02 +0200)]
Wrap MUTEX_{LOCK,UNLOCK} in macros so can we don't have to #ifdef them

12 years agoMGf_COPY and MGf_DUP should always be set for the perls we consider
Vincent Pit [Wed, 26 Oct 2011 09:40:16 +0000 (11:40 +0200)]
MGf_COPY and MGf_DUP should always be set for the perls we consider

12 years agoAbstract the MGWIZ creation into a new vmg_mgwiz_alloc() function
Vincent Pit [Tue, 25 Oct 2011 22:32:18 +0000 (00:32 +0200)]
Abstract the MGWIZ creation into a new vmg_mgwiz_alloc() function

12 years agoPass the 'data' callback after the 'op_info' flag when calling _wizard()
Vincent Pit [Tue, 25 Oct 2011 22:25:38 +0000 (00:25 +0200)]
Pass the 'data' callback after the 'op_info' flag when calling _wizard()

12 years agoThreads tests may not be able to spawn all the threads
Vincent Pit [Mon, 24 Oct 2011 19:57:55 +0000 (21:57 +0200)]
Threads tests may not be able to spawn all the threads

To work around this :
- move all the threads boilerplate to a new helper test module ;
- capture the warnings/errors that threads->create may throw and reprint
them properly as diagnostics ;
- don't set a plan in threads tests.

12 years agoRemove trailing whitespace
Vincent Pit [Mon, 24 Oct 2011 19:42:20 +0000 (21:42 +0200)]
Remove trailing whitespace

12 years agoMake sure code examples fit in a 80 columns terminal
Vincent Pit [Sun, 23 Oct 2011 15:31:20 +0000 (17:31 +0200)]
Make sure code examples fit in a 80 columns terminal

12 years agoPreserve the PATH environment variable when running a sub-perl on cygwin
Vincent Pit [Sun, 23 Oct 2011 14:55:07 +0000 (16:55 +0200)]
Preserve the PATH environment variable when running a sub-perl on cygwin

12 years agoSilence an "unused" compiler warning
Vincent Pit [Mon, 5 Sep 2011 17:46:40 +0000 (19:46 +0200)]
Silence an "unused" compiler warning

12 years agoTweak some optional module loading in tests
Vincent Pit [Sun, 4 Sep 2011 21:32:06 +0000 (23:32 +0200)]
Tweak some optional module loading in tests

12 years agoAdd META.json
Vincent Pit [Wed, 24 Aug 2011 17:42:12 +0000 (19:42 +0200)]
Add META.json

12 years agoEncode the README file in UTF-8
Vincent Pit [Wed, 24 Aug 2011 12:52:54 +0000 (14:52 +0200)]
Encode the README file in UTF-8

12 years agoReplace $] by "$]"
Vincent Pit [Sun, 7 Aug 2011 16:17:22 +0000 (18:17 +0200)]
Replace $] by "$]"

An old bug could cause $] to be initialized to a wrong decimal value.
Since its stringified value was always right, we use it instead.

Occurences of $^V were also replaced by $].

12 years agoIgnore MYMETA.json
Vincent Pit [Sun, 7 Aug 2011 16:05:30 +0000 (18:05 +0200)]
Ignore MYMETA.json

12 years agoUpdate vmg_opclass() for perl 5.15
Vincent Pit [Sun, 7 Aug 2011 16:04:39 +0000 (18:04 +0200)]
Update vmg_opclass() for perl 5.15

Even if magic is no longer called by the aelem(fast).

13 years agoThis is 0.46 v0.46
Vincent Pit [Sun, 23 Jan 2011 16:44:38 +0000 (17:44 +0100)]
This is 0.46

13 years agoSwitch to qw<>
Vincent Pit [Wed, 19 Jan 2011 17:45:36 +0000 (18:45 +0100)]
Switch to qw<>

13 years agoUpdate magical flags after dispelling magic rt64866
Vincent Pit [Wed, 19 Jan 2011 17:29:15 +0000 (18:29 +0100)]
Update magical flags after dispelling magic

This fixes RT #64866.

13 years agoBump copyright year
Vincent Pit [Tue, 18 Jan 2011 12:33:36 +0000 (13:33 +0100)]
Bump copyright year

13 years agoTighten the scope of two variables unused on 5.8
Vincent Pit [Tue, 18 Jan 2011 12:33:16 +0000 (13:33 +0100)]
Tighten the scope of two variables unused on 5.8

13 years agoThis is 0.45 v0.45
Vincent Pit [Sun, 21 Nov 2010 23:10:30 +0000 (00:10 +0100)]
This is 0.45

13 years agoA terser way to display versions for modules used in tests
Vincent Pit [Sun, 21 Nov 2010 22:56:26 +0000 (23:56 +0100)]
A terser way to display versions for modules used in tests

13 years agoOnly use Capture::Tiny when it is working on a simple example
Vincent Pit [Sun, 21 Nov 2010 22:43:16 +0000 (23:43 +0100)]
Only use Capture::Tiny when it is working on a simple example

13 years agoA bare glob that isn't part of a fetch doesn't call get magic anymore in 5.13.7
Vincent Pit [Sun, 21 Nov 2010 13:43:04 +0000 (14:43 +0100)]
A bare glob that isn't part of a fetch doesn't call get magic anymore in 5.13.7

13 years agoAdd more glob tests
Vincent Pit [Sun, 21 Nov 2010 13:42:06 +0000 (14:42 +0100)]
Add more glob tests

13 years agoWording fix
Vincent Pit [Sun, 21 Nov 2010 13:23:09 +0000 (14:23 +0100)]
Wording fix

13 years agoGive a saner default to pPTBLMS
Vincent Pit [Thu, 28 Oct 2010 22:20:04 +0000 (00:20 +0200)]
Give a saner default to pPTBLMS

This silences a compiler warning.

13 years agoSkip NULL values when walking a table
Vincent Pit [Thu, 28 Oct 2010 22:19:32 +0000 (00:19 +0200)]
Skip NULL values when walking a table

ptable_fetch already returns NULL for nonexistent entries, so NULL can't
possibly have any other meaning than "this node is not currently in use".

13 years agoAdd ptable_delete to ptable.h
Vincent Pit [Thu, 28 Oct 2010 22:18:08 +0000 (00:18 +0200)]
Add ptable_delete to ptable.h

13 years agoExplicitely state that C++ compilers aren't supported
Vincent Pit [Sat, 16 Oct 2010 12:34:04 +0000 (14:34 +0200)]
Explicitely state that C++ compilers aren't supported

13 years agoIgnore MYMETA.yml
Vincent Pit [Sun, 3 Oct 2010 00:22:17 +0000 (02:22 +0200)]
Ignore MYMETA.yml

13 years agoClarify minimum perl 5.10.0 requirement for hash magic
Peter Rabbitson [Sat, 25 Sep 2010 18:18:36 +0000 (20:18 +0200)]
Clarify minimum perl 5.10.0 requirement for hash magic

13 years agoThis is 0.44 v0.44
Vincent Pit [Fri, 24 Sep 2010 19:10:06 +0000 (21:10 +0200)]
This is 0.44

13 years agoCorrectly propagate exceptions from _wizard()
Vincent Pit [Fri, 24 Sep 2010 18:00:03 +0000 (20:00 +0200)]
Correctly propagate exceptions from _wizard()

13 years agoOnly load Carp.pm when throwing an error
Vincent Pit [Fri, 24 Sep 2010 17:59:24 +0000 (19:59 +0200)]
Only load Carp.pm when throwing an error

13 years agoDescribe why we don't have to guard against PL_dirty in vmg_mgwiz_free()
Vincent Pit [Fri, 24 Sep 2010 17:08:21 +0000 (19:08 +0200)]
Describe why we don't have to guard against PL_dirty in vmg_mgwiz_free()

13 years agoForce threads tests with the PERL_VARIABLE_MAGIC_TEST_THREADS environment variable
Vincent Pit [Fri, 24 Sep 2010 16:10:23 +0000 (18:10 +0200)]
Force threads tests with the PERL_VARIABLE_MAGIC_TEST_THREADS environment variable

13 years agoSkip threads tests unless perl version is 5.13.4 or greater
Vincent Pit [Fri, 24 Sep 2010 15:58:29 +0000 (17:58 +0200)]
Skip threads tests unless perl version is 5.13.4 or greater

There was a long standing bug in the handling of GV <-> CV double linkage
that could (and explicitely did with a poisonous perl) cause segfaults at
thread destruction. It got fixed by Dave in commit 803f274 which went in
5.13.3, but the fix was amended for 5.13.4 in commit 09aad8f. Since it's
not really fair for the user to not be able to install the module because
of this, we skip the threads tests unless perl is at least 5.13.4.

13 years agoRemove the patchlevel test
Vincent Pit [Thu, 23 Sep 2010 21:58:40 +0000 (23:58 +0200)]
Remove the patchlevel test

Commit d29a774d106d145036eda849ab57f42410100008 removed the only place it
was used, and perl left perforce almost three years ago.

13 years agoRemove the test for non-released perl 5.11.0
Vincent Pit [Thu, 23 Sep 2010 21:55:16 +0000 (23:55 +0200)]
Remove the test for non-released perl 5.11.0

Who would be crazy enough to still use them? And the test seems to break
with some git checkouts.

13 years agoForce linking against the perl dll when using gcc 3.4 on Windows
Vincent Pit [Thu, 23 Sep 2010 16:52:42 +0000 (18:52 +0200)]
Force linking against the perl dll when using gcc 3.4 on Windows

When a Windows perl links an XS shared object to an import library using
gcc/g++ version 3.4.x, strange breakage happens at load time because the
mutex-related symbols seems not to be reachable. This situation happens
especially for AS perl and the default compiler suite it installs.

We fix this by forcing g++ to link against the dll instead, which should
be in the same directory as the perl executable (at least for AS perl).

This (should) fix RT #51483.

13 years agoClarify some logic in Makefile.PL
Vincent Pit [Thu, 23 Sep 2010 14:45:12 +0000 (16:45 +0200)]
Clarify some logic in Makefile.PL

13 years agoSvREFCNT_dec already checks if the SV is non null
Vincent Pit [Thu, 19 Aug 2010 10:47:16 +0000 (12:47 +0200)]
SvREFCNT_dec already checks if the SV is non null

13 years agoThis is 0.43 v0.43
Vincent Pit [Fri, 25 Jun 2010 23:35:32 +0000 (01:35 +0200)]
This is 0.43

13 years agoMore control tests
Vincent Pit [Fri, 25 Jun 2010 23:10:43 +0000 (01:10 +0200)]
More control tests

13 years agoPrettify the constants export list
Vincent Pit [Fri, 25 Jun 2010 20:31:57 +0000 (22:31 +0200)]
Prettify the constants export list

13 years ago5.13.2 calls get magic on globs
Vincent Pit [Fri, 25 Jun 2010 20:30:18 +0000 (22:30 +0200)]
5.13.2 calls get magic on globs

Add the new compatibility macro VMG_COMPAT_GLOB_GET to reflect this change.

13 years agoFix CLONE_PARAMS struct initialization for perl 5.13.2
Vincent Pit [Fri, 25 Jun 2010 20:16:50 +0000 (22:16 +0200)]
Fix CLONE_PARAMS struct initialization for perl 5.13.2

13 years agoAlways use a safe version of call_sv()
Vincent Pit [Fri, 25 Jun 2010 20:05:22 +0000 (22:05 +0200)]
Always use a safe version of call_sv()

All the relevant code has been factored out of vmg_cb_free() into a new
vmg_call_sv() function.

13 years agoException propagation fixes
Vincent Pit [Fri, 25 Jun 2010 18:34:14 +0000 (20:34 +0200)]
Exception propagation fixes

First, make sure that exceptions thrown in a free callback at the end of a
regular block are propagated.

Second, prevent duplication of error messages when dieing in a free callback
at BEGIN time.

13 years agoThis is 0.42 v0.42
Vincent Pit [Wed, 19 May 2010 00:13:23 +0000 (02:13 +0200)]
This is 0.42

13 years agoFix tests for perl 5.13
Vincent Pit [Tue, 18 May 2010 23:46:47 +0000 (01:46 +0200)]
Fix tests for perl 5.13

13 years agoFix t/18-opinfo.t failures with perl 5.13
Vincent Pit [Tue, 18 May 2010 22:27:59 +0000 (00:27 +0200)]
Fix t/18-opinfo.t failures with perl 5.13

14 years agoComplete coverage of the len callback
Vincent Pit [Sat, 24 Apr 2010 21:46:47 +0000 (23:46 +0200)]
Complete coverage of the len callback

14 years agoImprove op_info coverage
Vincent Pit [Sat, 24 Apr 2010 21:01:49 +0000 (23:01 +0200)]
Improve op_info coverage

14 years agoThis is 0.41 v0.41
Vincent Pit [Mon, 15 Mar 2010 17:28:47 +0000 (18:28 +0100)]
This is 0.41

14 years agoCompatibility fix for 5.12.0
Vincent Pit [Mon, 15 Mar 2010 17:22:47 +0000 (18:22 +0100)]
Compatibility fix for 5.12.0

14 years agoA few doc corrections
Shlomi Fish [Sat, 6 Mar 2010 00:32:39 +0000 (01:32 +0100)]
A few doc corrections

14 years agoTune the userdata example
Vincent Pit [Tue, 23 Feb 2010 13:42:19 +0000 (14:42 +0100)]
Tune the userdata example

14 years agoCorrectly propagate the errors thrown when variable destruction happens at compile...
Vincent Pit [Wed, 13 Jan 2010 01:07:57 +0000 (02:07 +0100)]
Correctly propagate the errors thrown when variable destruction happens at compile-time

14 years agoThis is 0.40 v0.40
Vincent Pit [Wed, 6 Jan 2010 23:16:43 +0000 (00:16 +0100)]
This is 0.40