line |
stmt |
bran |
cond |
sub |
time |
code |
1
|
|
|
|
|
|
/* This code is compiled twice, once with -DPERL_CORE defined, once without */ |
2
|
|
|
|
|
|
|
3
|
|
|
|
|
|
#include "EXTERN.h" |
4
|
|
|
|
|
|
#include "perl.h" |
5
|
|
|
|
|
|
|
6
|
|
|
|
|
|
#ifdef PERL_CORE |
7
|
|
|
|
|
|
# define SUFFIX core |
8
|
|
|
|
|
|
#else |
9
|
|
|
|
|
|
# define SUFFIX notcore |
10
|
|
|
|
|
|
#endif |
11
|
|
|
|
|
|
|
12
|
|
|
|
|
|
bool |
13
|
2
|
|
|
|
|
CAT2(sv_setsv_cow_hashkey_, SUFFIX) () { |
14
|
|
|
|
|
|
dTHX; |
15
|
2
|
|
|
|
|
SV *source = newSVpvn_share("pie", 3, 0); |
16
|
2
|
|
|
|
|
SV *destination = newSV(0); |
17
|
|
|
|
|
|
bool result; |
18
|
|
|
|
|
|
|
19
|
2
|
|
|
|
|
if(!SvIsCOW(source)) { |
20
|
0
|
|
|
|
|
SvREFCNT_dec(source); |
21
|
0
|
|
|
|
|
Perl_croak(aTHX_ "Creating a shared hash key scalar failed when " |
22
|
0
|
|
|
|
|
STRINGIFY(SUFFIX) " got flags %"UVxf, (UV)SvFLAGS(source)); |
23
|
|
|
|
|
|
} |
24
|
|
|
|
|
|
|
25
|
2
|
|
|
|
|
sv_setsv(destination, source); |
26
|
|
|
|
|
|
|
27
|
2
|
|
|
|
|
result = !!SvIsCOW(destination); |
28
|
|
|
|
|
|
|
29
|
2
|
|
|
|
|
SvREFCNT_dec(source); |
30
|
2
|
|
|
|
|
SvREFCNT_dec(destination); |
31
|
|
|
|
|
|
|
32
|
2
|
|
|
|
|
return result; |
33
|
|
|
|
|
|
} |
34
|
|
|
|
|
|
|
35
|
|
|
|
|
|
/* |
36
|
|
|
|
|
|
* Local variables: |
37
|
|
|
|
|
|
* mode: c |
38
|
|
|
|
|
|
* c-indentation-style: bsd |
39
|
|
|
|
|
|
* c-basic-offset: 4 |
40
|
|
|
|
|
|
* indent-tabs-mode: nil |
41
|
|
|
|
|
|
* End: |
42
|
|
|
|
|
|
* |
43
|
|
|
|
|
|
* ex: set ts=8 sts=4 sw=4 et: |
44
|
|
|
|
|
|
*/ |