tcc_callback_ptr: Get the C-compatible function pointer

View source: R/callbacks.R

tcc_callback_ptrR Documentation

Get the C-compatible function pointer

Description

Returns an external pointer that can be passed to compiled C code as user data for trampolines. Keep this handle (and the original tcc_callback) alive for as long as C may call back. The pointer handle keeps the underlying token storage alive until it is garbage collected. Closing the original callback still invalidates the callback registry entry, so C must not continue invoking it after tcc_callback_close().

Usage

tcc_callback_ptr(callback)

Arguments

callback

A tcc_callback object

Details

Pointer arguments and return values are treated as external pointers. Use tcc_read_bytes(), tcc_read_u8(), or tcc_read_f64() to inspect pointed data when needed.

Value

An external pointer (address of the callback token)


Rtinycc documentation built on April 28, 2026, 1:07 a.m.