diff options
author | Joshua Haberman <jhaberman@gmail.com> | 2019-01-14 10:56:58 -0800 |
---|---|---|
committer | Joshua Haberman <jhaberman@gmail.com> | 2019-01-14 10:56:58 -0800 |
commit | cb26d883d1290ed258e5594454c2ffe0526b13f9 (patch) | |
tree | 8ca8c172333c159d8bf6c4e315376cdfb2f66882 /upb/generated_util.h | |
parent | a9c375f8ea81e52d832653c963da72033c9a98be (diff) |
WIP.
Diffstat (limited to 'upb/generated_util.h')
-rw-r--r-- | upb/generated_util.h | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/upb/generated_util.h b/upb/generated_util.h index 3989f1e..657280f 100644 --- a/upb/generated_util.h +++ b/upb/generated_util.h @@ -54,10 +54,9 @@ UPB_INLINE void *_upb_array_resize_accessor(void *msg, size_t ofs, size_t size, size_t new_size = UPB_MAX(arr->size, 4); size_t old_bytes = arr->size * elem_size; size_t new_bytes; - upb_alloc *alloc = upb_arena_alloc(arr->arena); while (new_size < size) new_size *= 2; new_bytes = new_size * elem_size; - arr->data = upb_realloc(alloc, arr->data, old_bytes, new_bytes); + arr->data = upb_arena_realloc(arena, arr->data, old_bytes, new_bytes); if (!arr->data) { return NULL; } |