This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
In newSVhek(), use sv_usepvn_flags() to avoid a malloc()/copy/free()
authorNicholas Clark <nick@ccl4.org>
Thu, 11 Nov 2010 21:37:48 +0000 (21:37 +0000)
committerNicholas Clark <nick@ccl4.org>
Thu, 11 Nov 2010 21:37:48 +0000 (21:37 +0000)
commit678febd75acbe46e48e9655d1e7c6345b1d04f0a
tree619f06ee1b50fda759b435f2d04e619d1c01fb1d
parentaf16de9fb95af5577c9af62f59b791ea3a98d2b9
In newSVhek(), use sv_usepvn_flags() to avoid a malloc()/copy/free()

The return value of bytes_to_utf8() is a malloc()ed string, which we can donate
to the scalar to use as its buffer. Previously the code free()d this memory,
after using it as a parameter to newSVpvn(), which allocates a new buffer and
copies to it.
sv.c