Skip to content

Commit

Permalink
Don't use variable-length arrays (#8021)
Browse files Browse the repository at this point in the history
There was a rogue use of VLAs (an extension we don't want to use) in one of the runtime tests. Fixed the test. I'll follow up with a separate PR to ensure this warning is enabled everywhere to flush out other usages.
  • Loading branch information
steven-johnson authored Jan 4, 2024
1 parent b661c8d commit daf011d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions test/runtime/memory_arena.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ int main(int argc, char **argv) {
MemoryArena::Config config = {sizeof(double), 32, 0};
MemoryArena *arena = MemoryArena::create(user_context, config, test_allocator);

size_t count = 4 * 1024;
constexpr size_t count = 4 * 1024;
void *pointers[count];
for (size_t n = 0; n < count; ++n) {
pointers[n] = arena->reserve(user_context, true);
Expand Down Expand Up @@ -75,7 +75,7 @@ int main(int argc, char **argv) {

arena.destroy(user_context);

size_t count = 4 * 1024;
constexpr size_t count = 4 * 1024;
void *pointers[count];
for (size_t n = 0; n < count; ++n) {
pointers[n] = arena.reserve(user_context, true);
Expand Down

0 comments on commit daf011d

Please sign in to comment.