diff options
| author | Philipp Gesang <phg42.2a@gmail.com> | 2013-05-02 21:45:14 +0200 | 
|---|---|---|
| committer | Philipp Gesang <phg42.2a@gmail.com> | 2013-05-02 21:45:14 +0200 | 
| commit | 00ba44f1939220af84ad885d1ba2f1f974bd7eb7 (patch) | |
| tree | 00feb239e278c2a2494747f168a4af42e6cbad7b | |
| parent | d95b4e16d9985c89c75b798c72acb795fd4813f0 (diff) | |
| download | luatexbase-00ba44f1939220af84ad885d1ba2f1f974bd7eb7.tar.gz | |
emit warning after 2^53 user whatsits
| -rw-r--r-- | luatexbase-attr.dtx | 6 | 
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 }  | 
