develooper Front page | perl.perl5.porters | Postings from September 2014

Re: sv_grow() and malloc()

Thread Previous | Thread Next
From:
demerphq
Date:
September 25, 2014 07:12
Subject:
Re: sv_grow() and malloc()
Message ID:
CANgJU+X-N5GDsaU0gcb3DaHx8_F=jvLFFoJCg+pWLU0LE=uCtw@mail.gmail.com
On 23 September 2014 13:49, Dave Mitchell <davem@iabyn.com> wrote:

> (this is spin-off from Reini's suggested work to tweak sv_grow()
> allocations).
>
> I've been thinking about about all our heuristics for growing (and
> over-growing) strings in sv_grow(), and how it's likely to interact with
> the OS's malloc() library.
>

At least one OS (sun maybe?) supports an introspection
routine Perl_safesysmalloc_size which exposes the canonical form of this
information.

Use of this routine in sv.c caused problems with the new COW logic and the
readline stuff so I disabled it. It can be re-enabled by defining:

PERL_UNWARANTED_CHUMMINESS_WITH_MALLOC

I do not recommend doing this, it confuses the COW logic quite a bit.

Yves

-- 
perl -Mre=debug -e "/just|another|perl|hacker/"

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About