Show / Hide Table of Contents

Class ExternMemory

Represents an external (instantiated) WebAssembly memory.

Inheritance
System.Object
ExternMemory
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: Wasmtime.Externs
Assembly: Wasmtime.Dotnet.dll
Syntax
public class ExternMemory

Properties

| Improve this Doc View Source

Maximum

The maximum memory size (in WebAssembly page units).

Declaration
public uint Maximum { get; }
Property Value
Type Description
System.UInt32
| Improve this Doc View Source

Minimum

The minimum memory size (in WebAssembly page units).

Declaration
public uint Minimum { get; }
Property Value
Type Description
System.UInt32
| Improve this Doc View Source

Name

The name of the WebAssembly memory.

Declaration
public string Name { get; }
Property Value
Type Description
System.String
| Improve this Doc View Source

Span

The span of the memory.

Declaration
public Span<byte> Span { get; }
Property Value
Type Description
System.Span<System.Byte>
Remarks

The span may become invalid if the memory grows.

This may happen if the memory is explicitly requested to grow or grows as a result of WebAssembly execution.

Therefore, the returned Span should not be stored.

Methods

| Improve this Doc View Source

ReadByte(Int32)

Reads a byte from memory.

Declaration
public byte ReadByte(int address)
Parameters
Type Name Description
System.Int32 address

The zero-based address to read from.

Returns
Type Description
System.Byte

Returns the byte read from memory.

| Improve this Doc View Source

ReadDouble(Int32)

Reads a double from memory.

Declaration
public double ReadDouble(int address)
Parameters
Type Name Description
System.Int32 address

The zero-based address to read from.

Returns
Type Description
System.Double

Returns the double read from memory.

| Improve this Doc View Source

ReadInt16(Int32)

Reads a short from memory.

Declaration
public short ReadInt16(int address)
Parameters
Type Name Description
System.Int32 address

The zero-based address to read from.

Returns
Type Description
System.Int16

Returns the short read from memory.

| Improve this Doc View Source

ReadInt32(Int32)

Reads an int from memory.

Declaration
public int ReadInt32(int address)
Parameters
Type Name Description
System.Int32 address

The zero-based address to read from.

Returns
Type Description
System.Int32

Returns the int read from memory.

| Improve this Doc View Source

ReadInt64(Int32)

Reads a long from memory.

Declaration
public long ReadInt64(int address)
Parameters
Type Name Description
System.Int32 address

The zero-based address to read from.

Returns
Type Description
System.Int64

Returns the long read from memory.

| Improve this Doc View Source

ReadIntPtr(Int32)

Reads an IntPtr from memory.

Declaration
public IntPtr ReadIntPtr(int address)
Parameters
Type Name Description
System.Int32 address

The zero-based address to read from.

Returns
Type Description
System.IntPtr

Returns the IntPtr read from memory.

| Improve this Doc View Source

ReadSingle(Int32)

Reads a long from memory.

Declaration
public float ReadSingle(int address)
Parameters
Type Name Description
System.Int32 address

The zero-based address to read from.

Returns
Type Description
System.Single

Returns the long read from memory.

| Improve this Doc View Source

ReadString(Int32, Int32)

Reads a UTF-8 string from memory.

Declaration
public string ReadString(int address, int length)
Parameters
Type Name Description
System.Int32 address

The zero-based address to read from.

System.Int32 length

The length of bytes to read.

Returns
Type Description
System.String

Returns the string read from memory.

| Improve this Doc View Source

WriteByte(Int32, Byte)

Writes a byte to memory.

Declaration
public void WriteByte(int address, byte value)
Parameters
Type Name Description
System.Int32 address

The zero-based address to write to.

System.Byte value

The byte to write.

| Improve this Doc View Source

WriteDouble(Int32, Double)

Writes a double to memory.

Declaration
public void WriteDouble(int address, double value)
Parameters
Type Name Description
System.Int32 address

The zero-based address to write to.

System.Double value

The double to write.

| Improve this Doc View Source

WriteInt16(Int32, Int16)

Writes a short to memory.

Declaration
public void WriteInt16(int address, short value)
Parameters
Type Name Description
System.Int32 address

The zero-based address to write to.

System.Int16 value

The short to write.

| Improve this Doc View Source

WriteInt32(Int32, Int32)

Writes an int to memory.

Declaration
public void WriteInt32(int address, int value)
Parameters
Type Name Description
System.Int32 address

The zero-based address to write to.

System.Int32 value

The int to write.

| Improve this Doc View Source

WriteInt64(Int32, Int64)

Writes a long to memory.

Declaration
public void WriteInt64(int address, long value)
Parameters
Type Name Description
System.Int32 address

The zero-based address to write to.

System.Int64 value

The long to write.

| Improve this Doc View Source

WriteIntPtr(Int32, IntPtr)

Writes an IntPtr to memory.

Declaration
public void WriteIntPtr(int address, IntPtr value)
Parameters
Type Name Description
System.Int32 address

The zero-based address to write to.

System.IntPtr value

The IntPtr to write.

| Improve this Doc View Source

WriteSingle(Int32, Single)

Writes a single to memory.

Declaration
public void WriteSingle(int address, float value)
Parameters
Type Name Description
System.Int32 address

The zero-based address to write to.

System.Single value

The single to write.

| Improve this Doc View Source

WriteString(Int32, String)

Writes a UTF-8 string at the given address.

Declaration
public int WriteString(int address, string value)
Parameters
Type Name Description
System.Int32 address

The zero-based address to write to.

System.String value

The string to write.

Returns
Type Description
System.Int32
  • Improve this Doc
  • View Source
Back to top Generated by DocFX