Beispiel #1
0
        /// <summary>
        /// Returns byte size of the underlying TST
        /// </summary>
        public override long SizeInBytes()
        {
            long mem = RamUsageEstimator.ShallowSizeOf(this);

            if (root != null)
            {
                mem += root.sizeInBytes();
            }
            return(mem);
        }
Beispiel #2
0
        internal virtual long sizeInBytes()
        {
            long mem = RamUsageEstimator.ShallowSizeOf(this);

            if (loKid != null)
            {
                mem += loKid.sizeInBytes();
            }
            if (eqKid != null)
            {
                mem += eqKid.sizeInBytes();
            }
            if (hiKid != null)
            {
                mem += hiKid.sizeInBytes();
            }
            if (token != null)
            {
                mem += RamUsageEstimator.ShallowSizeOf(token) + RamUsageEstimator.NUM_BYTES_ARRAY_HEADER + RamUsageEstimator.NUM_BYTES_CHAR * token.Length;
            }
            mem += RamUsageEstimator.ShallowSizeOf(val);
            return(mem);
        }