summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhilipp Gesang <phg42.2a@gmail.com>2013-05-02 21:45:14 +0200
committerPhilipp Gesang <phg42.2a@gmail.com>2013-05-02 21:45:14 +0200
commit00ba44f1939220af84ad885d1ba2f1f974bd7eb7 (patch)
tree00feb239e278c2a2494747f168a4af42e6cbad7b
parentd95b4e16d9985c89c75b798c72acb795fd4813f0 (diff)
downloadluatexbase-00ba44f1939220af84ad885d1ba2f1f974bd7eb7.tar.gz
emit warning after 2^53 user whatsits
-rw-r--r--luatexbase-attr.dtx6
1 files changed, 6 insertions, 0 deletions
diff --git a/luatexbase-attr.dtx b/luatexbase-attr.dtx
index 5a4960c..7c8f5b9 100644
--- a/luatexbase-attr.dtx
+++ b/luatexbase-attr.dtx
@@ -465,6 +465,7 @@ local user_whatsits = { --- (package, (name, id hash)) hash
__unassociated = { }, --- those without package name
}
local whatsit_ids = { } --- (id, (name * package)) hash
+local whatsit_cap = 2^53 --- Lua numbers are doubles
local current_whatsit = 0
local anonymous_whatsits = 0
local anonymous_prefix = "anon"
@@ -509,6 +510,11 @@ local new_user_whatsit_id = function (name, package)
warning("replacing whatsit %s:%s (%d)", package, name, id)
else --- new id
current_whatsit = current_whatsit + 1
+ if current_whatsit >= whatsit_cap then
+ warning("maximum of %d integral user whatsit ids reached",
+ whatsit_cap)
+ warning("further whatsit allocation may be inconsistent")
+ end
id = current_whatsit
whatsitdata[name] = id
whatsit_ids[id] = { name, package }