-
Notifications
You must be signed in to change notification settings - Fork 34
Expand file tree
/
Copy pathEngine.java
More file actions
42 lines (34 loc) · 1.1 KB
/
Copy pathEngine.java
File metadata and controls
42 lines (34 loc) · 1.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
package io.github.kawamuray.wasmtime;
import lombok.AccessLevel;
import lombok.AllArgsConstructor;
import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.experimental.Accessors;
/**
* An Engine which is a global context for compilation and management of wasm modules.
* <p>
* Engines store global configuration preferences such as compilation settings, enabled features, etc.
* You'll likely only need at most one of these for a program.
*
* @see <a href="https://docs.wasmtime.dev/api/wasmtime/struct.Engine.html">Rust Documentation</a>
*/
@Accessors(fluent = true)
@EqualsAndHashCode
@AllArgsConstructor(access = AccessLevel.PACKAGE)
public class Engine implements Disposable {
static {
NativeLibraryLoader.init();
}
@Getter(AccessLevel.PACKAGE)
private long innerPtr;
public Engine() {
this(newEngine());
}
public Engine(Config config){
this(newEngineWithConfig(config));
}
@Override
public native void dispose();
private static native long newEngine();
private static native long newEngineWithConfig(Config config);
}