diff options
author | Mark D. Roth <roth@google.com> | 2018-01-22 12:51:03 -0800 |
---|---|---|
committer | Mark D. Roth <roth@google.com> | 2018-01-22 12:51:03 -0800 |
commit | 62569dd9785e59a6b87a5002d09aeec1c39f541b (patch) | |
tree | b7e0fd0f075b891af60f1c6736a04ed12f77bf16 /test/core/gpr/arena_test.cc | |
parent | a9fc084ec1be4ab8f2071227d9affb77f713e0db (diff) |
Fix arena to return aligned memory.
Diffstat (limited to 'test/core/gpr/arena_test.cc')
-rw-r--r-- | test/core/gpr/arena_test.cc | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/test/core/gpr/arena_test.cc b/test/core/gpr/arena_test.cc index 59ea04c0ed..62a3f8bf50 100644 --- a/test/core/gpr/arena_test.cc +++ b/test/core/gpr/arena_test.cc @@ -53,6 +53,8 @@ static void test(const char* name, size_t init_size, const size_t* allocs, void** ps = static_cast<void**>(gpr_zalloc(sizeof(*ps) * nallocs)); for (size_t i = 0; i < nallocs; i++) { ps[i] = gpr_arena_alloc(a, allocs[i]); + // ensure the returned address is aligned + GPR_ASSERT(((intptr_t)ps[i] & 0xf) == 0); // ensure no duplicate results for (size_t j = 0; j < i; j++) { GPR_ASSERT(ps[i] != ps[j]); |