summaryrefslogtreecommitdiff
path: root/ext
diff options
context:
space:
mode:
authorNicholas Clark <nick@ccl4.org>2011-06-27 20:51:04 +0200
committerNicholas Clark <nick@ccl4.org>2011-07-01 14:05:40 +0200
commit4185c9197f4aefd1943fba0b9999fc3200fd902c (patch)
tree34f48cfebcfa6a796f4496c890400c3a7d89da6c /ext
parent75fc7bf602cd498829b35780623ebe139c0a0483 (diff)
downloadperl-4185c9197f4aefd1943fba0b9999fc3200fd902c.tar.gz
Store C<study>'s data in in mg_ptr instead of interpreter variables.
This allows more than one C<study> to be active at the same time. It eliminates PL_screamfirst, PL_lastscream, PL_maxscream.
Diffstat (limited to 'ext')
-rw-r--r--ext/Devel-Peek/t/Peek.t36
1 files changed, 24 insertions, 12 deletions
diff --git a/ext/Devel-Peek/t/Peek.t b/ext/Devel-Peek/t/Peek.t
index 5a007af682..642d34c09b 100644
--- a/ext/Devel-Peek/t/Peek.t
+++ b/ext/Devel-Peek/t/Peek.t
@@ -857,17 +857,14 @@ unless ($Config{useithreads}) {
do_test('regular string constant', beer,
'SV = PV\\($ADDR\\) at $ADDR
- REFCNT = 5
+ REFCNT = 6
FLAGS = \\(PADMY,POK,READONLY,pPOK\\)
PV = $ADDR "foamy"\\\0
CUR = 5
LEN = \d+
');
- is(study beer, 1, "Our studies were successful");
-
- do_test('string constant now studied', beer,
-'SV = PVMG\\($ADDR\\) at $ADDR
+ my $want = 'SV = PVMG\\($ADDR\\) at $ADDR
REFCNT = 6
FLAGS = \\(PADMY,SMG,POK,READONLY,pPOK,SCREAM\\)
IV = 0
@@ -878,22 +875,37 @@ unless ($Config{useithreads}) {
MAGIC = $ADDR
MG_VIRTUAL = &PL_vtbl_regexp
MG_TYPE = PERL_MAGIC_study\\(G\\)
-');
+ MG_LEN = 1044
+ MG_PTR = $ADDR "\\\\377\\\\377\\\\377\\\\377.*"
+';
+
+ is(study beer, 1, "Our studies were successful");
+
+ do_test('string constant now studied', beer, $want);
is (eval 'index "not too foamy", beer', 8, 'correct index');
- do_test('string constant still studied', beer,
-'SV = PVMG\\($ADDR\\) at $ADDR
- REFCNT = 6
- FLAGS = \\(PADMY,SMG,POK,READONLY,pPOK,SCREAM\\)
+ do_test('string constant still studied', beer, $want);
+
+ my $pie = 'good';
+
+ is(study $pie, 1, "Our studies were successful");
+
+ do_test('string constant still studied', beer, $want);
+
+ do_test('second string also studied', $pie, 'SV = PVMG\\($ADDR\\) at $ADDR
+ REFCNT = 1
+ FLAGS = \\(PADMY,SMG,POK,pPOK,SCREAM\\)
IV = 0
NV = 0
- PV = $ADDR "foamy"\\\0
- CUR = 5
+ PV = $ADDR "good"\\\0
+ CUR = 4
LEN = \d+
MAGIC = $ADDR
MG_VIRTUAL = &PL_vtbl_regexp
MG_TYPE = PERL_MAGIC_study\\(G\\)
+ MG_LEN = 1040
+ MG_PTR = $ADDR "\\\\377\\\\377\\\\377\\\\377.*"
');
}