summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMike Hommey <mh@glandium.org>2014-05-21 08:24:08 (GMT)
committerJason Evans <je@fb.com>2014-05-27 22:10:38 (GMT)
commitf41f14366877538b03109ecf346dbff2e21bbb16 (patch)
tree03072601f2def4b9752b58ec234242ab983e3f71
parentd6fd11413e1fe33a9bc947d794e880d7d10f7786 (diff)
downloadjemalloc-f41f14366877538b03109ecf346dbff2e21bbb16.zip
jemalloc-f41f14366877538b03109ecf346dbff2e21bbb16.tar.gz
jemalloc-f41f14366877538b03109ecf346dbff2e21bbb16.tar.bz2
Replace variable arrays in tests with VARIABLE_ARRAY
-rw-r--r--test/unit/hash.c4
-rw-r--r--test/unit/mallctl.c2
2 files changed, 3 insertions, 3 deletions
diff --git a/test/unit/hash.c b/test/unit/hash.c
index abb394a..77a8ced 100644
--- a/test/unit/hash.c
+++ b/test/unit/hash.c
@@ -64,8 +64,8 @@ hash_variant_verify(hash_variant_t variant)
{
const size_t hashbytes = hash_variant_bits(variant) / 8;
uint8_t key[256];
- uint8_t hashes[hashbytes * 256];
- uint8_t final[hashbytes];
+ VARIABLE_ARRAY(uint8_t, hashes, hashbytes * 256);
+ VARIABLE_ARRAY(uint8_t, final, hashbytes);
unsigned i;
uint32_t computed, expected;
diff --git a/test/unit/mallctl.c b/test/unit/mallctl.c
index cb12049..7a8b55f 100644
--- a/test/unit/mallctl.c
+++ b/test/unit/mallctl.c
@@ -285,7 +285,7 @@ TEST_BEGIN(test_arenas_initialized)
assert_d_eq(mallctl("arenas.narenas", &narenas, &sz, NULL, 0), 0,
"Unexpected mallctl() failure");
{
- bool initialized[narenas];
+ VARIABLE_ARRAY(bool, initialized, narenas);
sz = narenas * sizeof(bool);
assert_d_eq(mallctl("arenas.initialized", initialized, &sz,