Comments (10)
What do you mean "memory is empty"? The parsed module has WasmKit.Memory
in memories
and WasmKit.DataSegment
in data
.
from wasmkit.
What do you mean "memory is empty"? The parsed module has
WasmKit.Memory
inmemories
andWasmKit.DataSegment
indata
.
Yes, look at the output of WasmKit.Export(name: "memory", descriptor: WasmKit.ExportDescriptor.memory(0))]
from wasmkit.
@996ccs WasmKit.ExportDescriptor.memory(0)
means the export entry points to the index 0 of memories
from wasmkit.
@996ccs
WasmKit.ExportDescriptor.memory(0)
means the export entry points to the index 0 ofmemories
Thank you very much for your reply. Please tell me how to obtain the initializer data in WasmKit.DataSegment. Like this data WasmKit.DataSegment.Active(index: 0, offset: [WasmKit.Instruction.numericConst(I32(1048))], initializer: ArraySlice([2, 0, 0, 0, 22, 0, 0, 0 , 104, 0, 101, 0, 108, 0, 108, 0, 111, 0, 32, 0, 119, 0, 111, 0, 114, 0, 108, 0, 100]))) How do I get initializer.
from wasmkit.
I don't understand what you are trying to do but you can get the data segment initializer by something like below:
let initializer = switch dataSegment {
case .active(let active): Array(active.initializer)
case .passive(let initializer): initializer
}
from wasmkit.
I don't understand what you are trying to do but you can get the data segment initializer by something like below:
let initializer = switch dataSegment { case .active(let active): Array(active.initializer) case .passive(let initializer): initializer }
I used the code you provided and encountered the same problem myself. The error message 'initializer' is inaccessible due to 'internal' protection level
from wasmkit.
Could you try it again with main branch of WasmKit?
from wasmkit.
Could you try it again with main branch of WasmKit?
I updated version 0.04, and now the data under the module cannot be accessed. My need is to get the initializer: ArraySlice in WasmParser.DataSegment.active. Can it be exposed? Thanks
from wasmkit.
Ah, sorry. If you just want to extract data segment, you can use WasmParser module directly.
from wasmkit.
Ah, sorry. If you just want to extract data segment, you can use WasmParser module directly.
Can you tell me what I should do? Because I am not good at wasmkit and swift development
from wasmkit.
Related Issues (12)
- No LICENSE file HOT 2
- Tagging a release HOT 2
- Import object HOT 1
- stackTypeMismatch when using `drop` instruction and when using globals when there is a local HOT 2
- Enhance documentation
- Faster execution to enable all executable tests in apple/swift
- Validate all functions ahead of time
- Fatal error when running: Examples/wasm/fib.wasm HOT 1
- CMake build
- Test on Windows
- Make WASI deterministic HOT 7
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from wasmkit.