github.com/vedadiyan/sqlparser@v1.0.0/pkg/topodata/cached_size.go (about)

     1  /*
     2  Copyright 2021 The Vitess Authors.
     3  
     4  Licensed under the Apache License, Version 2.0 (the "License");
     5  you may not use this file except in compliance with the License.
     6  You may obtain a copy of the License at
     7  
     8      http://www.apache.org/licenses/LICENSE-2.0
     9  
    10  Unless required by applicable law or agreed to in writing, software
    11  distributed under the License is distributed on an "AS IS" BASIS,
    12  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    13  See the License for the specific language governing permissions and
    14  limitations under the License.
    15  */
    16  // Code generated by Sizegen. DO NOT EDIT.
    17  
    18  package topodata
    19  
    20  import hack "github.com/vedadiyan/sqlparser/pkg/hack"
    21  
    22  func (cached *KeyRange) CachedSize(alloc bool) int64 {
    23  	if cached == nil {
    24  		return int64(0)
    25  	}
    26  	size := int64(0)
    27  	if alloc {
    28  		size += int64(96)
    29  	}
    30  	// field unknownFields []byte
    31  	{
    32  		size += hack.RuntimeAllocSize(int64(cap(cached.unknownFields)))
    33  	}
    34  	// field Start []byte
    35  	{
    36  		size += hack.RuntimeAllocSize(int64(cap(cached.Start)))
    37  	}
    38  	// field End []byte
    39  	{
    40  		size += hack.RuntimeAllocSize(int64(cap(cached.End)))
    41  	}
    42  	return size
    43  }