summaryrefslogtreecommitdiffstats
path: root/src/sat/bsat2/Alloc.h
diff options
context:
space:
mode:
authorwhitequark <whitequark@whitequark.org>2020-12-29 13:35:31 +0000
committerMiodrag Milanovic <mmicko@gmail.com>2021-11-12 12:38:41 +0100
commite289a8059eac7d0514f8a20ffe6464fc18db1450 (patch)
tree9cd00ced8077caeb9bdf376911ab1b4e3b5fe355 /src/sat/bsat2/Alloc.h
parentd2d6bbd9f86f61fc9b5cc7d703e1386bbd6ad6a2 (diff)
downloadabc-e289a8059eac7d0514f8a20ffe6464fc18db1450.tar.gz
abc-e289a8059eac7d0514f8a20ffe6464fc18db1450.tar.bz2
abc-e289a8059eac7d0514f8a20ffe6464fc18db1450.zip
Add WASI platform support to bsat2 and glucose.
Abort on OOM since there are no C++ exceptions yet. Signed-off-by: Miodrag Milanovic <mmicko@gmail.com>
Diffstat (limited to 'src/sat/bsat2/Alloc.h')
-rw-r--r--src/sat/bsat2/Alloc.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/sat/bsat2/Alloc.h b/src/sat/bsat2/Alloc.h
index 7f506cb5..9a65cf0c 100644
--- a/src/sat/bsat2/Alloc.h
+++ b/src/sat/bsat2/Alloc.h
@@ -97,7 +97,11 @@ void RegionAllocator<T>::capacity(uint32_t min_cap)
cap += delta;
if (cap <= prev_cap)
+#ifdef __wasm
+ abort();
+#else
throw OutOfMemoryException();
+#endif
}
// printf(" .. (%p) cap = %u\n", this, cap);
@@ -119,7 +123,11 @@ RegionAllocator<T>::alloc(int size)
// Handle overflow:
if (sz < prev_sz)
+#ifdef __wasm
+ abort();
+#else
throw OutOfMemoryException();
+#endif
return prev_sz;
}