Sha256: b3bac33b3f5c3ee895eee9f91ce0b1f5a1734781d70d51abca8b22b8914e4a89

Contents?: true

Size: 926 Bytes

Versions: 22

Compression:

Stored size: 926 Bytes

Contents

// Protocol Buffers - Google's data interchange format
// Copyright 2023 Google LLC.  All rights reserved.
//
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file or at
// https://developers.google.com/open-source/licenses/bsd

#include "upb/reflection/internal/desc_state.h"

// Must be last.
#include "upb/port/def.inc"

bool _upb_DescState_Grow(upb_DescState* d, upb_Arena* a) {
  const size_t oldbufsize = d->bufsize;
  const int used = d->ptr - d->buf;

  if (!d->buf) {
    d->buf = upb_Arena_Malloc(a, d->bufsize);
    if (!d->buf) return false;
    d->ptr = d->buf;
    d->e.end = d->buf + d->bufsize;
  }

  if (oldbufsize - used < kUpb_MtDataEncoder_MinSize) {
    d->bufsize *= 2;
    d->buf = upb_Arena_Realloc(a, d->buf, oldbufsize, d->bufsize);
    if (!d->buf) return false;
    d->ptr = d->buf + used;
    d->e.end = d->buf + d->bufsize;
  }

  return true;
}

Version data entries

22 entries across 22 versions & 1 rubygems

Version Path
grpc-1.67.0 third_party/upb/upb/reflection/desc_state.c
grpc-1.67.0.pre1 third_party/upb/upb/reflection/desc_state.c
grpc-1.66.0 third_party/upb/upb/reflection/desc_state.c
grpc-1.66.0.pre5 third_party/upb/upb/reflection/desc_state.c
grpc-1.66.0.pre3 third_party/upb/upb/reflection/desc_state.c
grpc-1.60.2 third_party/upb/upb/reflection/desc_state.c
grpc-1.61.3 third_party/upb/upb/reflection/desc_state.c
grpc-1.62.3 third_party/upb/upb/reflection/desc_state.c
grpc-1.63.2 third_party/upb/upb/reflection/desc_state.c
grpc-1.64.3 third_party/upb/upb/reflection/desc_state.c
grpc-1.65.2 third_party/upb/upb/reflection/desc_state.c
grpc-1.65.1 third_party/upb/upb/reflection/desc_state.c
grpc-1.65.0 third_party/upb/upb/reflection/desc_state.c
grpc-1.65.0.pre2 third_party/upb/upb/reflection/desc_state.c
grpc-1.65.0.pre1 third_party/upb/upb/reflection/desc_state.c
grpc-1.63.0 third_party/upb/upb/reflection/desc_state.c
grpc-1.62.0 third_party/upb/upb/reflection/desc_state.c
grpc-1.62.0.pre1 third_party/upb/upb/reflection/desc_state.c
grpc-1.61.0 third_party/upb/upb/reflection/desc_state.c
grpc-1.61.0.pre2 third_party/upb/upb/reflection/desc_state.c