summaryrefslogtreecommitdiff
path: root/src/wasm.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/wasm.h')
-rw-r--r--src/wasm.h9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/wasm.h b/src/wasm.h
index 12071fdb4..763a4e764 100644
--- a/src/wasm.h
+++ b/src/wasm.h
@@ -858,7 +858,9 @@ public:
static const Address::address_t kPageMask = ~(kPageSize - 1);
struct Segment {
- Expression* offset;
+ bool isPassive = false;
+ Index index = 0;
+ Expression* offset = nullptr;
std::vector<char> data; // TODO: optimize
Segment() = default;
Segment(Expression* offset) : offset(offset) {}
@@ -869,6 +871,11 @@ public:
Segment(Expression* offset, std::vector<char>& init) : offset(offset) {
data.swap(init);
}
+ Segment(bool isPassive, Expression* offset, const char* init, Address size)
+ : isPassive(isPassive), offset(offset) {
+ data.resize(size);
+ std::copy_n(init, size, data.begin());
+ }
};
bool exists = false;