Commit 43a6ada3 authored by Volker Dobler's avatar Volker Dobler Committed by Nigel Tao

publicsuffix: allow to encode up to 1023 children in the table

The number of children (494) got pretty close to the available maximum
number of children (511) in the table. This number increased over the
last year by roughly 65 indicating that we would run out of space in
the next three months. The other fields still have enough room left.
The following table show the growth over the last 1.5 years:

    # Commit Date Children TextOffset Length High Low
    b05061f 2017-09-18 494 28750 36 8407 8402
    859d1a86 2017-09-06 494 28750 36 8407 8402
    ddf80d09 2017-06-14 479 28411 36 8262 8257
    61557ac0 2017-01-26 466 28023 36 8121 8120
    5695785b 2016-10-20 434 27930 36 8135 8134
    07b51741 2016-08-11 424 27866 36 8062 8051
    7864c9ee 2016-07-07 421 27811 36 8049 8038
    3f122ce3 2016-06-09 417 27680 36 8029 8018
    d58ca661 2016-03-04 409 27059 36 7887 7886
    6c581b96 2016-02-01 406 26999 36 7868 7867
    78e1654e 2016-01-20 405 26986 36 7863 7862

Given this rate of grow of max text offset it will overflow in 2021.
Thus use the last of the available 32 bits to encode more children.

Change-Id: I04db02100b202f220a0b4ee509f868db031fd8ab
Reviewed-on: https://go-review.googlesource.com/64330Reviewed-by: 's avatarNigel Tao <nigeltao@golang.org>
parent 411fb0e2
......@@ -37,7 +37,7 @@ import (
const (
// These sum of these four values must be no greater than 32.
nodesBitsChildren = 9
nodesBitsChildren = 10
nodesBitsICANN = 1
nodesBitsTextOffset = 15
nodesBitsTextLength = 6
......
......@@ -5,7 +5,7 @@ package publicsuffix
const version = "publicsuffix.org's public_suffix_list.dat, git revision 38b238d6324042f2c2e6270459d1f4ccfe789fba (2017-08-28T20:09:01Z)"
const (
nodesBitsChildren = 9
nodesBitsChildren = 10
nodesBitsICANN = 1
nodesBitsTextOffset = 15
nodesBitsTextLength = 6
......@@ -489,8 +489,8 @@ const text = "bifukagawalterbihorologyukuhashimoichinosekigaharaxastronomy-gat"
// An I denotes an ICANN domain.
//
// The layout within the uint32, from MSB to LSB, is:
// [ 1 bits] unused
// [ 9 bits] children index
// [ 0 bits] unused
// [10 bits] children index
// [ 1 bits] ICANN bit
// [15 bits] text index
// [ 6 bits] text length
......@@ -9412,7 +9412,7 @@ var children = [...]uint32{
0x835e0d2,
}
// max children 494 (capacity 511)
// max children 494 (capacity 1023)
// max text offset 28750 (capacity 32767)
// max text length 36 (capacity 63)
// max hi 8407 (capacity 16383)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment