diff options
author | Joshua Haberman <jhaberman@gmail.com> | 2017-01-24 10:38:50 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-01-24 10:38:50 -0800 |
commit | 73a48a46f83402669e654e8c0d0c297e2c5390a0 (patch) | |
tree | 09e1f9d42c000d54c31653dc9d8b9e570c41a597 /upb/upb.c | |
parent | 72ae34c28fb93ca1e45920d9e8714c74c7292dee (diff) | |
parent | 3b7dc27fb5497903145a52413116fad25fbaf138 (diff) |
Merge pull request #78 from haberman/axerefcount
Fixed amalgamated build and added test.
Diffstat (limited to 'upb/upb.c')
-rw-r--r-- | upb/upb.c | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -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? */ |