public final class CGlobalDataFactory extends Object
Modifier and Type | Method and Description |
---|---|
static <T extends org.graalvm.word.PointerBase> |
createBytes(IntSupplier sizeSupplier)
Create a chunk of zero-initialized bytes with at least the length that is provided by the
specified supplier.
|
static <T extends org.graalvm.word.PointerBase> |
createBytes(IntSupplier sizeSupplier,
String symbolName)
Same as
CGlobalDataFactory.createBytes(IntSupplier) , and additionally creates a symbol with the
provided name for the allocated bytes. |
static <T extends org.graalvm.word.PointerBase> |
createBytes(Supplier<byte[]> contentSupplier)
Create a chunk of bytes that is dimensioned and initialized to contain the bytes provided by
the specified supplier.
|
static <T extends org.graalvm.word.PointerBase> |
createBytes(Supplier<byte[]> contentSupplier,
String symbolName)
Same as
CGlobalDataFactory.createBytes(Supplier) , and additionally creates a symbol with the provided
name for the allocated bytes. |
static <T extends org.graalvm.word.PointerBase> |
createCString(String content)
Create a chunk of data that is dimensioned and initialized to contain the provided string's
contents as zero-terminated modified UTF-8.
|
static <T extends org.graalvm.word.PointerBase> |
createCString(String content,
String symbolName)
Same as
CGlobalDataFactory.createCString(String) , and additionally creates a symbol with the provided
name for the allocated string. |
static <T extends org.graalvm.word.PointerBase> |
createWord()
Create a single word that is initialized to zero.
|
static <T extends org.graalvm.word.PointerBase> |
createWord(String symbolName)
Same as
CGlobalDataFactory.createWord() , and additionally creates a symbol with the provided name for
the allocated word. |
static <T extends org.graalvm.word.PointerBase> |
createWord(org.graalvm.word.WordBase initialValue)
Create a single word that is initialized to the specified value.
|
static <T extends org.graalvm.word.PointerBase> |
createWord(org.graalvm.word.WordBase initialValue,
String symbolName)
Same as
CGlobalDataFactory.createWord(WordBase) , and additionally creates a symbol with the provided
name for the allocated word. |
static <T extends org.graalvm.word.PointerBase> |
forSymbol(String symbolName)
Create a reference to the symbol with the specified name.
|
public static <T extends org.graalvm.word.PointerBase> CGlobalData<T> forSymbol(String symbolName)
CGlobalData.get()
on the returned object at runtime returns the referenced symbol's address.public static <T extends org.graalvm.word.PointerBase> CGlobalData<T> createCString(String content)
public static <T extends org.graalvm.word.PointerBase> CGlobalData<T> createCString(String content, String symbolName)
CGlobalDataFactory.createCString(String)
, and additionally creates a symbol with the provided
name for the allocated string.public static <T extends org.graalvm.word.PointerBase> CGlobalData<T> createBytes(IntSupplier sizeSupplier)
public static <T extends org.graalvm.word.PointerBase> CGlobalData<T> createBytes(IntSupplier sizeSupplier, String symbolName)
CGlobalDataFactory.createBytes(IntSupplier)
, and additionally creates a symbol with the
provided name for the allocated bytes.public static <T extends org.graalvm.word.PointerBase> CGlobalData<T> createBytes(Supplier<byte[]> contentSupplier)
public static <T extends org.graalvm.word.PointerBase> CGlobalData<T> createBytes(Supplier<byte[]> contentSupplier, String symbolName)
CGlobalDataFactory.createBytes(Supplier)
, and additionally creates a symbol with the provided
name for the allocated bytes.public static <T extends org.graalvm.word.PointerBase> CGlobalData<T> createWord(org.graalvm.word.WordBase initialValue)
public static <T extends org.graalvm.word.PointerBase> CGlobalData<T> createWord(org.graalvm.word.WordBase initialValue, String symbolName)
CGlobalDataFactory.createWord(WordBase)
, and additionally creates a symbol with the provided
name for the allocated word.public static <T extends org.graalvm.word.PointerBase> CGlobalData<T> createWord()
public static <T extends org.graalvm.word.PointerBase> CGlobalData<T> createWord(String symbolName)
CGlobalDataFactory.createWord()
, and additionally creates a symbol with the provided name for
the allocated word.