summaryrefslogtreecommitdiff
path: root/doc/lispref/internals.texi
diff options
context:
space:
mode:
authorPaul Eggert <eggert@cs.ucla.edu>2019-12-14 14:22:03 -0800
committerPaul Eggert <eggert@cs.ucla.edu>2019-12-14 14:22:35 -0800
commit9ee5af315098245d9f58eb5562dca6997cab4426 (patch)
treef9f90d488353a6afc39ecff67a87077c2b194802 /doc/lispref/internals.texi
parentbb42f6ef10cb250a9263b17a8794e950a563d5d0 (diff)
downloademacs-9ee5af315098245d9f58eb5562dca6997cab4426.tar.gz
emacs-9ee5af315098245d9f58eb5562dca6997cab4426.tar.bz2
emacs-9ee5af315098245d9f58eb5562dca6997cab4426.zip
Adjust intptr_t advice
* doc/lispref/internals.texi (C Integer Types): Say to prefer uintptr_t when pointer arithmetic might overflow intptr_t.
Diffstat (limited to 'doc/lispref/internals.texi')
-rw-r--r--doc/lispref/internals.texi10
1 files changed, 6 insertions, 4 deletions
diff --git a/doc/lispref/internals.texi b/doc/lispref/internals.texi
index 8c55f4ea373..2a4e64dbb56 100644
--- a/doc/lispref/internals.texi
+++ b/doc/lispref/internals.texi
@@ -2825,12 +2825,14 @@ POSIX requires support only for values in the range @minus{}1 ..@:
@code{SSIZE_MAX}.
@item
-Prefer @code{intptr_t} for internal representations of pointers, or
+Normally, prefer @code{intptr_t} for internal representations of pointers, or
for integers bounded only by the number of objects that can exist at
any given time or by the total number of bytes that can be allocated.
-Currently Emacs sometimes uses other types when @code{intptr_t} would
-be better; fixing this is lower priority, as the code works as-is on
-Emacs's current porting targets.
+However, prefer @code{uintptr_t} to represent pointer arithmetic that
+could cross page boundaries. For example, on a machine with a 32-bit
+address space an array could cross the 0x7fffffff/0x80000000 boundary,
+which would cause an integer overflow when adding 1 to
+@code{(intptr_t) 0x7fffffff}.
@item
Prefer the Emacs-defined type @code{EMACS_INT} for representing values