When processing JSON as a stream, it is conceivable that the total number of elements in a JSON object or array exceeds a 32-bit integer.
Switch from int to int64 for a similar reason as why io.Copy returns int64 instead of int.
Note that the depth still uses an int because the stack must be representable in memory, which is limited to the native integer width of the platform. This is similar to how io.Reader.Read returns an int because the length of a []byte cannot possibly be larger than the largest int.
WARNING: This commit includes breaking changes.
When processing JSON as a stream, it is conceivable that the total number of elements in a JSON object or array exceeds a 32-bit integer.
Switch from int to int64 for a similar reason as why io.Copy returns int64 instead of int.
Note that the depth still uses an int because the stack must be representable in memory, which is limited to the native integer width of the platform. This is similar to how io.Reader.Read returns an int because the length of a []byte cannot possibly be larger than the largest int.