summaryrefslogtreecommitdiff
path: root/util.c
diff options
context:
space:
mode:
authorYves Orton <demerphq@gmail.com>2022-10-31 14:41:27 +0100
committerYves Orton <demerphq@gmail.com>2022-11-01 11:57:31 +0100
commit6848aea2c844896efb347e6a210098c7dd447567 (patch)
treefd5ac721106fe55e061272248af6c7982bf1966a /util.c
parent4bd3be3563698eb6e927a62c29755b216b926a27 (diff)
downloadperl-6848aea2c844896efb347e6a210098c7dd447567.tar.gz
op.c - use refcounted pv pointers for cop_warnings
this allows multiple ops to share the same underlying warning bit vector. the vectors are not deduped, however they are efficiently copied and shared.
Diffstat (limited to 'util.c')
-rw-r--r--util.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/util.c b/util.c
index aa3a1ae481..df229da352 100644
--- a/util.c
+++ b/util.c
@@ -2391,10 +2391,7 @@ Perl_new_warnings_bitfield(pTHX_ STRLEN *buffer, const char *const bits,
PERL_UNUSED_CONTEXT;
PERL_ARGS_ASSERT_NEW_WARNINGS_BITFIELD;
- buffer = (STRLEN*)
- (specialWARN(buffer) ?
- PerlMemShared_malloc(len_wanted) :
- PerlMemShared_realloc(buffer, len_wanted));
+ buffer = (STRLEN*)rcpv_new(NULL, len_wanted, RCPVf_NO_COPY);
buffer[0] = size;
Copy(bits, (buffer + 1), size, char);
if (size < WARNsize)