package extism

  1. Overview
  2. Docs

Some helpter functions for reading/writing memory

val to_val : memory_block -> Val.t

Convert memory block to Val

val of_val : t -> Val.t -> memory_block option

Convert Val to memory block

val of_val_exn : t -> Val.t -> memory_block

Convert Val to memory block, raises Invalid_argument if the value is not a pointer to a valid memory block

val get_string : t -> memory_block -> string

Get a string from memory stored at the provided offset

val get_bigstring : t -> memory_block -> Bigstringaf.t

Get a bigstring from memory stored at the provided offset

val set_string : t -> memory_block -> string -> unit

Store a string into memory at the provided offset

val set_bigstring : t -> memory_block -> Bigstringaf.t -> unit

Store a bigstring into memory at the provided offset

OCaml

Innovation. Community. Security.