summaryrefslogtreecommitdiff
path: root/pod/perlclib.pod
diff options
context:
space:
mode:
authorJarkko Hietaniemi <jhi@iki.fi>2002-05-19 00:28:51 +0000
committerJarkko Hietaniemi <jhi@iki.fi>2002-05-19 00:28:51 +0000
commit9965345dfe11415fe4409828505acf6c7fe193b9 (patch)
tree698244d2acf57eb8a374213afbc7d3b728b26182 /pod/perlclib.pod
parent48eb4d6f7d05204aa5e734e924c7236048de530c (diff)
downloadperl-9965345dfe11415fe4409828505acf6c7fe193b9.tar.gz
Sarathy pointed out that instead of zeroing heap
it is more prudent to poison it. p4raw-id: //depot/perl@16688
Diffstat (limited to 'pod/perlclib.pod')
-rw-r--r--pod/perlclib.pod10
1 files changed, 10 insertions, 0 deletions
diff --git a/pod/perlclib.pod b/pod/perlclib.pod
index 7c527a9a7a..e89a67a140 100644
--- a/pod/perlclib.pod
+++ b/pod/perlclib.pod
@@ -132,6 +132,16 @@ instead of raw C<char *> strings:
Note also the existence of C<sv_catpvf> and C<sv_vcatpvfn>, combining
concatenation with formatting.
+Sometimes instead of zeroing the allocated heap by using Newz() you
+should consider "poisoning" the data. This means writing a bit
+pattern into it that should be illegal as pointers (and floating point
+numbers), and also hopefully surprising enough as integers, so that
+any code attempting to use the data without forethought will break
+sooner rather than later. Poisoning can be done using the Poison()
+macro, which has similar arguments as Zero():
+
+ Poison(dst, n, t)
+
=head2 Character Class Tests
There are two types of character class tests that Perl implements: one