summaryrefslogtreecommitdiff
path: root/util.c
diff options
context:
space:
mode:
authorKarl Williamson <public@khwilliamson.com>2013-12-02 21:46:37 -0700
committerKarl Williamson <public@khwilliamson.com>2013-12-03 10:05:23 -0700
commit0358c255174b7f6c26a079baa5044df321529a6e (patch)
tree7ff0f6a347a7bdcf7abe5faeeef349731c72d0a2 /util.c
parentcfe9d637d2e0b4dba3963f2628e2893126c514e3 (diff)
downloadperl-0358c255174b7f6c26a079baa5044df321529a6e.tar.gz
perlapi: May want to use savesharedpv on threaded Win32
Adds a note to savepv (and similar) that on threaded Windows that you may need to use the saveshared version because the memory is deallocated when the thread ends.
Diffstat (limited to 'util.c')
-rw-r--r--util.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/util.c b/util.c
index 2b075c9aa3..3bb368f913 100644
--- a/util.c
+++ b/util.c
@@ -896,6 +896,10 @@ string which is a duplicate of C<pv>. The size of the string is
determined by C<strlen()>. The memory allocated for the new string can
be freed with the C<Safefree()> function.
+On some platforms, Windows for example, all allocated memory owned by a thread
+is deallocated when that thread ends. So if you need that not to happen, you
+need to use the shared memory functions, such as C<L</savesharedpv>>.
+
=cut
*/
@@ -923,6 +927,10 @@ pointer to a newly allocated string which is a duplicate of the first
C<len> bytes from C<pv>, plus a trailing NUL byte. The memory allocated for
the new string can be freed with the C<Safefree()> function.
+On some platforms, Windows for example, all allocated memory owned by a thread
+is deallocated when that thread ends. So if you need that not to happen, you
+need to use the shared memory functions, such as C<L</savesharedpvn>>.
+
=cut
*/
@@ -999,6 +1007,10 @@ Perl_savesharedpvn(pTHX_ const char *const pv, const STRLEN len)
A version of C<savepv()>/C<savepvn()> which gets the string to duplicate from
the passed in SV using C<SvPV()>
+On some platforms, Windows for example, all allocated memory owned by a thread
+is deallocated when that thread ends. So if you need that not to happen, you
+need to use the shared memory functions, such as C<L</savesharedsvpv>>.
+
=cut
*/