summaryrefslogtreecommitdiff
path: root/pod/perlguts.pod
diff options
context:
space:
mode:
authorJarkko Hietaniemi <jhi@iki.fi>2000-08-26 04:40:41 +0000
committerJarkko Hietaniemi <jhi@iki.fi>2000-08-26 04:40:41 +0000
commit8908e76d53bb0a0d1093b7e53a5526fcb8c4098d (patch)
tree91debf8ef033d12c0135af747c73dc4f66bb1a8c /pod/perlguts.pod
parent43d061fe52313c1575ca694d93c020f6eb8aec4f (diff)
downloadperl-8908e76d53bb0a0d1093b7e53a5526fcb8c4098d.tar.gz
Document PTR2XX and INT2PTR.
p4raw-id: //depot/perl@6832
Diffstat (limited to 'pod/perlguts.pod')
-rw-r--r--pod/perlguts.pod23
1 files changed, 23 insertions, 0 deletions
diff --git a/pod/perlguts.pod b/pod/perlguts.pod
index b1cd636fbe..74b901d7fe 100644
--- a/pod/perlguts.pod
+++ b/pod/perlguts.pod
@@ -1898,6 +1898,29 @@ For example:
The IVdf will expand to whatever is the correct format for the IVs.
+If you are printing addresses of pointers, use UVxf combined
+with PTR2UV(), do not use %lx or %p.
+
+=head2 Pointer-To-Integer and Integer-To-Pointer
+
+Because pointer size does not necessarily equal integer size,
+use the follow macros to do it right.
+
+ PTR2UV(pointer)
+ PTR2IV(pointer)
+ PTR2NV(pointer)
+ INT2PTR(pointertotype, integer)
+
+For example:
+
+ IV iv = ...;
+ SV *sv = INT2PTR(SV*, iv);
+
+and
+
+ AV *av = ...;
+ UV uv = PTR2UV(av);
+
=head2 Source Documentation
There's an effort going on to document the internal functions and