/** * Create a chunk of zero-initialized bytes with at least the length that is provided by the * specified supplier. */ public static <T extends PointerBase> CGlobalData<T> createBytes(IntSupplier sizeSupplier) { return createBytes(sizeSupplier, null); }
/** * Create a chunk of data that is dimensioned and initialized to contain the provided string's * contents as {@linkplain Utf8#stringToUtf8(String, boolean) zero-terminated modified UTF-8}. */ public static <T extends PointerBase> CGlobalData<T> createCString(String content) { return createCString(content, null); }
/** * Create a single word that is initialized to the specified value. */ public static <T extends PointerBase> CGlobalData<T> createWord(WordBase initialValue) { return createWord(initialValue, null); }
public CGlobalDataInfo addOrLookupMethod(ResolvedJavaMethod method) { if (method.getAnnotation(NodeIntrinsic.class) != null || method.getAnnotation(Word.Operation.class) != null) { return null; } return nameToFunction.computeIfAbsent(linkageName(method), symbolName -> { CGlobalData<CFunctionPointer> linkage = CGlobalDataFactory.forSymbol(symbolName); return CGlobalDataFeature.singleton().registerAsAccessed(linkage); }); }
public CGlobalDataInfo getBuiltInAddress() { assert this.isBuiltInFunction(); if (builtInAddress == null) { CGlobalData<CFunctionPointer> linkage = CGlobalDataFactory.forSymbol(this.getShortName()); builtInAddress = CGlobalDataFeature.singleton().registerAsAccessed(linkage); } return builtInAddress; }
/** * Create a chunk of bytes that is dimensioned and initialized to contain the bytes provided by * the specified supplier. */ public static <T extends PointerBase> CGlobalData<T> createBytes(Supplier<byte[]> contentSupplier) { return createBytes(contentSupplier, null); }
/** * Create a single word that is initialized to zero. */ public static <T extends PointerBase> CGlobalData<T> createWord() { return createWord((String) null); }