summaryrefslogtreecommitdiff
path: root/src/mixed_arena.h
diff options
context:
space:
mode:
authorAlon Zakai <azakai@google.com>2019-05-01 14:48:41 -0700
committerGitHub <noreply@github.com>2019-05-01 14:48:41 -0700
commit2bd3758a22131cfd6925b3fd995657b211095c90 (patch)
tree2a38a48ab68c00ed1b55e885f86014bbdda92ff2 /src/mixed_arena.h
parent73709b4da08d285c2237c8c23a54ba53274c0c7f (diff)
downloadbinaryen-2bd3758a22131cfd6925b3fd995657b211095c90.tar.gz
binaryen-2bd3758a22131cfd6925b3fd995657b211095c90.tar.bz2
binaryen-2bd3758a22131cfd6925b3fd995657b211095c90.zip
clang-tidy braces changes (#2075)
Applies the changes in #2065, and temprarily disables the hook since it's too slow to run on a change this large. We should re-enable it in a later commit.
Diffstat (limited to 'src/mixed_arena.h')
-rw-r--r--src/mixed_arena.h9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/mixed_arena.h b/src/mixed_arena.h
index 36bf22a5e..079ce9028 100644
--- a/src/mixed_arena.h
+++ b/src/mixed_arena.h
@@ -113,8 +113,9 @@ struct MixedArena {
// otherwise, the cmpxchg updated seen, and we continue to loop
curr = seen;
}
- if (allocated)
+ if (allocated) {
delete allocated;
+ }
return curr->allocSpace(size, align);
}
// First, move the current index in the last chunk to an aligned position.
@@ -125,8 +126,9 @@ struct MixedArena {
assert(size <= numChunks * CHUNK_SIZE);
auto* allocation =
wasm::aligned_malloc(MAX_ALIGN, numChunks * CHUNK_SIZE);
- if (!allocation)
+ if (!allocation) {
abort();
+ }
chunks.push_back(allocation);
index = 0;
}
@@ -155,8 +157,9 @@ struct MixedArena {
~MixedArena() {
clear();
- if (next.load())
+ if (next.load()) {
delete next.load();
+ }
}
};