thrift/lib/cpp2/frozen/Frozen.h
size_t layoutBytesDistance(size_t origin, size_t count, size_t align) {
    assert(0 == (align & (align - 1)));
    if (count == 0) {
      return 0;
    }
    if (cursor_ < origin) {
      cursor_ = origin;
    }
    // assume worst case alignment is hit when we're actually freezing
    cursor_ += align - 1;
    auto worstCaseDistance = cursor_ - origin;
    cursor_ += count;
    return worstCaseDistance;
  }
/**
   * Simulates appending count bytes, returning their offset (in bytes) from
   * origin.
   */
Simulates appending count bytes, returning their offset (in bytes) from
origin.
Simulates appending count bytes returning their offset ( in bytes ) from origin .
size_t layoutBytesDistance(size_t origin, size_t count, size_t align) {
    assert(0 == (align & (align - 1)));
    if (count == 0) {
      return 0;
    }
    if (cursor_ < origin) {
      cursor_ = origin;
    }
    cursor_ += align - 1;
    auto worstCaseDistance = cursor_ - origin;
    cursor_ += count;
    return worstCaseDistance;
  }
size_t layoutBytesDistance ( size_t origin , size_t count , size_t align ) { assert ( 0 == ( align & ( align - 1 ) ) ) ; if ( count == 0 ) { return 0 ; } if ( cursor_ < origin ) { cursor_ = origin ; } cursor_ += align - 1 ; auto worstCaseDistance = cursor_ - origin ; cursor_ += count ; return worstCaseDistance ; }
Simulates appending count bytes, returning their offset (in bytes) from
 origin.
Simulates appending count bytes returning their offset ( in bytes ) from origin .
// assume worst case alignment is hit when we're actually freezing