OmniSciDB  a5dc49c757
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
File_Namespace::anonymous_namespace{FileBuffer.cpp} Namespace Reference

Functions

size_t calculate_buffer_header_size (size_t chunk_size)
 

Function Documentation

size_t File_Namespace::anonymous_namespace{FileBuffer.cpp}::calculate_buffer_header_size ( size_t  chunk_size)

Definition at line 146 of file FileBuffer.cpp.

References File_Namespace::FileBuffer::kHeaderBufferOffset.

Referenced by File_Namespace::FileBuffer::getMinPageSize(), and File_Namespace::FileBuffer::setBufferHeaderSize().

146  {
147  // Additional 3 * sizeof(int32_t) is for headerSize, pageId, and versionEpoch
148  size_t header_size = (chunk_size + 3) * sizeof(int32_t);
149  size_t header_mod = header_size % FileBuffer::kHeaderBufferOffset;
150  if (header_mod > 0) {
151  header_size += FileBuffer::kHeaderBufferOffset - header_mod;
152  }
153  return header_size;
154 }

+ Here is the caller graph for this function: