aboutsummaryrefslogtreecommitdiff
path: root/src/common/torint.h
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2004-12-02 04:33:01 +0000
committerNick Mathewson <nickm@torproject.org>2004-12-02 04:33:01 +0000
commita980446d0cf8f455c49f6543bd8486b442e326b1 (patch)
tree2a575e8d2b88971d850174fbe35de613142508d5 /src/common/torint.h
parentdb5e100cde18bfb5d35c409f0fbb62e8e7438c38 (diff)
downloadtor-a980446d0cf8f455c49f6543bd8486b442e326b1.tar.gz
tor-a980446d0cf8f455c49f6543bd8486b442e326b1.zip
Be more proactive about noticing underflows: size_t values greater than 0x800...00 are likely to be trouble.
svn:r3064
Diffstat (limited to 'src/common/torint.h')
-rw-r--r--src/common/torint.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/common/torint.h b/src/common/torint.h
index af2775a8cb..1973db0d81 100644
--- a/src/common/torint.h
+++ b/src/common/torint.h
@@ -232,5 +232,8 @@ typedef uint32_t uintptr_t;
#endif
#endif
+/* Any size_t larger than this amount is likely to be an underflow. */
+#define SIZE_T_CEILING (1u<<(sizeof(size_t)*8 - 1))
+
#endif /* __TORINT_H */