summaryrefslogtreecommitdiff
path: root/upb/upb.c
diff options
context:
space:
mode:
authorJosh Haberman <jhaberman@gmail.com>2017-01-24 10:00:28 -0800
committerJosh Haberman <jhaberman@gmail.com>2017-01-24 10:08:06 -0800
commit3b7dc27fb5497903145a52413116fad25fbaf138 (patch)
tree09e1f9d42c000d54c31653dc9d8b9e570c41a597 /upb/upb.c
parent5aa01b46e41dcdbbd2dad6d1b7ecce9a60b8ce7a (diff)
Fixed amalgamated build and added test.
Diffstat (limited to 'upb/upb.c')
-rw-r--r--upb/upb.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/upb/upb.c b/upb/upb.c
index c24ac04..97f6c61 100644
--- a/upb/upb.c
+++ b/upb/upb.c
@@ -104,7 +104,7 @@ upb_alloc upb_alloc_global = {&upb_global_allocfunc};
/* Be conservative and choose 16 in case anyone is using SSE. */
static const size_t maxalign = 16;
-static size_t align_up(size_t size) {
+static size_t align_up_max(size_t size) {
return ((size + maxalign - 1) / maxalign) * maxalign;
}
@@ -128,7 +128,7 @@ static void upb_arena_addblock(upb_arena *a, void *ptr, size_t size,
block->next = a->block_head;
block->size = size;
- block->used = align_up(sizeof(mem_block));
+ block->used = align_up_max(sizeof(mem_block));
block->owned = owned;
a->block_head = block;
@@ -161,7 +161,7 @@ static void *upb_arena_doalloc(upb_alloc *alloc, void *ptr, size_t oldsize,
return NULL; /* We are an arena, don't need individual frees. */
}
- size = align_up(size);
+ size = align_up_max(size);
/* TODO(haberman): special-case if this is a realloc of the last alloc? */
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback