Commit 3ebd9b11 authored by Timothy Trindle's avatar Timothy Trindle

Increase arenaSpace for emscripten builds

parent 523d4f94
......@@ -133,11 +133,17 @@ public:
private:
ReaderOptions options;
#if defined(__EMSCRIPTEN__)
static constexpr size_t arenaSpacePadding = 19;
#else
static constexpr size_t arenaSpacePadding = 18;
#endif
// Space in which we can construct a ReaderArena. We don't use ReaderArena directly here
// because we don't want clients to have to #include arena.h, which itself includes a bunch of
// other headers. We don't use a pointer to a ReaderArena because that would require an
// extra malloc on every message which could be expensive when processing small messages.
void* arenaSpace[18 + sizeof(kj::MutexGuarded<void*>) / sizeof(void*)];
void* arenaSpace[arenaSpacePadding + sizeof(kj::MutexGuarded<void*>) / sizeof(void*)];
bool allocatedArena;
_::ReaderArena* arena() { return reinterpret_cast<_::ReaderArena*>(arenaSpace); }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment