develooper Front page | perl.perl5.porters | Postings from March 2003

[DOCPATCH] Re: [PATCH] Re: [perl #21614] 5.8.0 Unbalanced string table refcount

Thread Previous | Thread Next
Nicholas Clark
March 27, 2003 14:47
[DOCPATCH] Re: [PATCH] Re: [perl #21614] 5.8.0 Unbalanced string table refcount
Message ID:
On Tue, Mar 25, 2003 at 10:59:17PM +0000, Nicholas Clark wrote:

> I'm not convinced that it's the cleanest logic yet. I think that it would
> actually be better to move the sv_release_COW() call from
> sv_force_normal_flags into sv_grow. (Which is actually back close to 5.8.0)
> This way for this case sv_grow gets to call malloc once with the correct
> size. Also it means that most third party XS code doesn't need to be aware
> of copy on write - if it happens to call SvGROW to ensure that a buffer is
> large enough before writing to it, then it would automatically do the
> copy.

I can't see a clean way to do this. (which is annoying). It's do-able, but
it looks like it will add two bursts of checking for COW for every call to

On Thu, Mar 27, 2003 at 12:21:39AM +0100, Rafael Garcia-Suarez wrote:
> Nicholas Clark wrote:

> > Oh er erk. I've been working on a better one, which is tested, and I don't
> > have time to resync to 19069 and then retry. Would it be possible to revert
> > 19069 and apply the appended to blead.
> Yup, it's possible. Thanks, applied as #19071.


On Wed, Mar 26, 2003 at 11:30:05PM +0100, Rafael Garcia-Suarez wrote:

> BTW I notice that SvIsCOW is not documented in perlapi.pod. That's un-nice.

Is this suitable?

Nicholas Clark

--- sv.h.orig	Tue Mar 11 19:29:28 2003
+++ sv.h	Thu Mar 27 22:28:53 2003
@@ -920,6 +920,14 @@ Like C<SvPV>, but converts sv to byte re
 Guarantees to evaluate sv only once; use the more efficient C<SvPVbyte>
+=for apidoc Am|bool|SvIsCOW|SV* sv
+Returns a boolean indicating whether the SV is Copy-On-Write. (either shared
+hash key scalars, or full Copy On Write scalars if 5.9.0 is configured for
+=for apidoc Am|bool|SvIsCOW_shared_hash|SV* sv
+Returns a boolean indicating whether the SV is Copy-On-Write shared hash key

Thread Previous | Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About