Skip to content

Instantly share code, notes, and snippets.

@parttimenerd
Created April 8, 2024 11:04
Show Gist options
  • Save parttimenerd/d59e3e4213da08b192332cc2c8386d9e to your computer and use it in GitHub Desktop.
Save parttimenerd/d59e3e4213da08b192332cc2c8386d9e to your computer and use it in GitHub Desktop.
  • segment.setUtf8String(0, obj); -> segment.setString(0, obj);
  • same with getUtf8String
  • MemoryLayout.sequenceLayout(JAVA_BYTE) -> MemoryLayout.sequenceLayout(0, JAVA_BYTE)
  • arena.allocateUtf8String(string) -> allocateFrom(string)
  • var readers = arena.allocateArray(PanamaUtil.POINTER, perfBuffers.size()); -> var readers = arena.allocate(PanamaUtil.POINTER, perfBuffers.size());
  • jextract:
    • Callbacks: "X" -> "X.function"
    • bcc_symbol.module$get(sym) -> module(sym)
    • Lib.open(pathInC, O_RDONLY) (var args (?)) -> Lib.open.makeInvoker().apply(pathInC, O_RDONLY) (extern int open(const char *__file, int __oflag, ...))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment