Beaver.MLIR.StringRef (beaver v0.3.5)

This module defines functions working with MLIR StringRef.

Summary

Functions

Create a Elixir owned null-terminated C string from a Elixir bitstring and create a StringRef from it.

Converts an StringRef to a string.

Types

@type t() :: %Beaver.MLIR.StringRef{bag: term(), ref: term()}

Functions

Create a Elixir owned null-terminated C string from a Elixir bitstring and create a StringRef from it.

Note: A StringRef will not reference the original BEAM binary. Instead, it will reference a copy of the binary and owns it. In other words, excessively creating StringRef using this function can lead to memory leak.

Link to this function

to_string(string_ref)

Converts an StringRef to a string.