A lower-level, programmatic API for creating trampolines from infix_type objects.
More...
|
| | Type System |
| | The core data structures and APIs for describing C types and function signatures.
|
| |
|
| c23_nodiscard infix_status | infix_forward_create_manual (infix_forward_t **, infix_type *, infix_type **, size_t, size_t, void *) |
| | Creates a bound forward trampoline from infix_type objects.
|
| |
| c23_nodiscard infix_status | infix_forward_create_unbound_manual (infix_forward_t **, infix_type *, infix_type **, size_t, size_t) |
| | Creates an unbound forward trampoline from infix_type objects.
|
| |
| c23_nodiscard infix_status | infix_reverse_create_callback_manual (infix_reverse_t **, infix_type *, infix_type **, size_t, size_t, void *) |
| | Creates a type-safe reverse trampoline (callback) from infix_type objects.
|
| |
| c23_nodiscard infix_status | infix_reverse_create_closure_manual (infix_reverse_t **, infix_type *, infix_type **, size_t, size_t, infix_closure_handler_fn, void *) |
| | Creates a generic reverse trampoline (closure) from infix_type objects.
|
| |
| void | infix_forward_destroy (infix_forward_t *) |
| | Destroys a forward trampoline and frees all associated memory.
|
| |
| void | infix_reverse_destroy (infix_reverse_t *) |
| | Destroys a reverse trampoline and frees all associated memory.
|
| |
A lower-level, programmatic API for creating trampolines from infix_type objects.
This API is intended for performance-critical applications or language bindings that need to construct type information dynamically without the overhead of string parsing. All infix_type objects passed to these functions must be allocated from an infix_arena_t.
◆ infix_forward_create_manual()
Creates a bound forward trampoline from infix_type objects.
- Parameters
-
| [out] | out_trampoline | Receives the created trampoline handle. |
| [in] | return_type | The infix_type for the function's return value. |
| [in] | arg_types | An array of infix_type* for the function's arguments. |
| [in] | num_args | The number of arguments. |
| [in] | num_fixed_args | The number of non-variadic arguments. |
| [in] | target_function | The address of the C function to call. |
- Returns
INFIX_SUCCESS on success.
Creates a bound forward trampoline from infix_type objects.
This is the lower-level, programmatic way to create a bound forward trampoline. It bypasses the signature string parser, making it suitable for performance-critical applications or language bindings that construct type information dynamically.
All infix_type objects passed to this function must be fully resolved and have a valid layout. They should be allocated from a user-managed infix_arena_t.
- Parameters
-
| [out] | out_trampoline | Receives the created trampoline handle. |
| [in] | return_type | The infix_type for the function's return value. |
| [in] | arg_types | An array of infix_type* for the function's arguments. |
| [in] | num_args | The number of arguments. |
| [in] | num_fixed_args | The number of non-variadic arguments. |
| [in] | target_function | The address of the C function to call. |
- Returns
INFIX_SUCCESS on success.
◆ infix_forward_create_unbound_manual()
Creates an unbound forward trampoline from infix_type objects.
- Parameters
-
| [out] | out_trampoline | Receives the created trampoline handle. |
| [in] | return_type | The infix_type for the function's return value. |
| [in] | arg_types | An array of infix_type* for the function's arguments. |
| [in] | num_args | The number of arguments. |
| [in] | num_fixed_args | The number of non-variadic arguments. |
- Returns
INFIX_SUCCESS on success.
Creates an unbound forward trampoline from infix_type objects.
This is the lower-level, programmatic way to create an unbound forward trampoline. It bypasses the signature string parser.
- Parameters
-
| [out] | out_trampoline | Receives the created trampoline handle. |
| [in] | return_type | The infix_type for the function's return value. |
| [in] | arg_types | An array of infix_type* for the function's arguments. |
| [in] | num_args | The number of arguments. |
| [in] | num_fixed_args | The number of non-variadic arguments. |
- Returns
INFIX_SUCCESS on success.
◆ infix_forward_destroy()
Destroys a forward trampoline and frees all associated memory.
- Parameters
-
| [in] | trampoline | The trampoline to destroy. Safe to call with nullptr. |
This function safely releases all resources owned by the trampoline, including its JIT-compiled executable code and its private memory arena which stores the deep-copied type information.
- Parameters
-
| [in] | trampoline | The trampoline to destroy. Safe to call with nullptr. |
◆ infix_reverse_create_callback_manual()
Creates a type-safe reverse trampoline (callback) from infix_type objects.
- Parameters
-
| [out] | out_context | Receives the created context handle. |
| [in] | return_type | The function's return type. |
| [in] | arg_types | An array of argument types. |
| [in] | num_args | The number of arguments. |
| [in] | num_fixed_args | The number of non-variadic arguments. |
| [in] | user_callback_fn | A pointer to the type-safe C handler function. |
- Returns
INFIX_SUCCESS on success.
Creates a type-safe reverse trampoline (callback) from infix_type objects.
- Parameters
-
| [out] | out_context | Receives the created context handle. |
| [in] | return_type | The function's return type. |
| [in] | arg_types | An array of argument types. |
| [in] | num_args | The number of arguments. |
| [in] | num_fixed_args | The number of non-variadic arguments. |
| [in] | user_callback_fn | A pointer to the type-safe C handler function. |
- Returns
INFIX_SUCCESS on success.
◆ infix_reverse_create_closure_manual()
Creates a generic reverse trampoline (closure) from infix_type objects.
- Parameters
-
| [out] | out_context | Receives the created context handle. |
| [in] | return_type | The function's return type. |
| [in] | arg_types | An array of argument types. |
| [in] | num_args | The number of arguments. |
| [in] | num_fixed_args | The number of non-variadic arguments. |
| [in] | user_callback_fn | A pointer to the generic infix_closure_handler_fn. |
| [in] | user_data | A void* pointer to application-specific state. |
- Returns
INFIX_SUCCESS on success.
Creates a generic reverse trampoline (closure) from infix_type objects.
- Parameters
-
| [out] | out_context | Receives the created context handle. |
| [in] | return_type | The function's return type. |
| [in] | arg_types | An array of argument types. |
| [in] | num_args | The number of arguments. |
| [in] | num_fixed_args | The number of non-variadic arguments. |
| [in] | user_callback_fn | A pointer to the generic infix_closure_handler_fn. |
| [in] | user_data | A void* pointer to application-specific state. |
- Returns
INFIX_SUCCESS on success.
◆ infix_reverse_destroy()
Destroys a reverse trampoline and frees all associated memory.
- Parameters
-
| [in] | reverse_trampoline | The reverse trampoline context to destroy. Safe to call with nullptr. |
This function safely releases all resources owned by the reverse trampoline, including its JIT-compiled stub, its private memory arena, the cached forward trampoline (if any), and the special read-only memory region for the context itself.
- Parameters
-
| [in] | reverse_trampoline | The reverse trampoline context to destroy. Safe to call with nullptr. |