summaryrefslogtreecommitdiff
path: root/src/binaryen-c.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/binaryen-c.cpp')
-rw-r--r--src/binaryen-c.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/binaryen-c.cpp b/src/binaryen-c.cpp
index d0c672abd..3d311f5bd 100644
--- a/src/binaryen-c.cpp
+++ b/src/binaryen-c.cpp
@@ -3722,6 +3722,20 @@ size_t BinaryenGetMemorySegmentByteLength(BinaryenModuleRef module,
const Memory::Segment& segment = wasm->memory.segments[id];
return segment.data.size();
}
+int BinaryenGetMemorySegmentPassive(BinaryenModuleRef module,
+ BinaryenIndex id) {
+ if (tracing) {
+ std::cout << " BinaryenGetMemorySegmentPassive(the_module, " << id
+ << ");\n";
+ }
+
+ auto* wasm = (Module*)module;
+ if (wasm->memory.segments.size() <= id) {
+ Fatal() << "invalid segment id.";
+ }
+ const Memory::Segment& segment = wasm->memory.segments[id];
+ return segment.isPassive;
+}
void BinaryenCopyMemorySegmentData(BinaryenModuleRef module,
BinaryenIndex id,
char* buffer) {