infix
A JIT-Powered FFI Library for C
|
Implements OS-level memory management and the internal callback dispatcher. More...
#include "common/infix_internals.h"
#include "common/utility.h"
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>
#include <errno.h>
#include <fcntl.h>
#include <sys/mman.h>
#include <sys/types.h>
#include <unistd.h>
#include <stdint.h>
Go to the source code of this file.
Functions | |
static int | shm_open_anonymous () |
c23_nodiscard infix_executable_t | infix_executable_alloc (size_t size) |
Allocates a page-aligned block of W^X-compliant executable memory. | |
void | infix_executable_free (infix_executable_t exec) |
Frees executable memory, creating a guard page to prevent use-after-free. | |
c23_nodiscard bool | infix_executable_make_executable (infix_executable_t exec) |
Makes a JIT memory region readable and executable (and non-writable). | |
c23_nodiscard infix_protected_t | infix_protected_alloc (size_t size) |
Allocates a page-aligned block of data memory. | |
void | infix_protected_free (infix_protected_t prot) |
Frees a block of protected data memory. | |
c23_nodiscard bool | infix_protected_make_readonly (infix_protected_t prot) |
Hardens a block of protected data memory to be read-only. | |
void | infix_internal_dispatch_callback_fn_impl (infix_reverse_t *context, void *return_value_ptr, void **args_array) |
The high-level C dispatcher function called by reverse trampoline stubs. | |
Implements OS-level memory management and the internal callback dispatcher.
Copyright (c) 2025 Sanko Robinson
This source code is dual-licensed under the Artistic License 2.0 or the MIT License. You may choose to use this code under the terms of either license.
SPDX-License-Identifier: (Artistic-2.0 OR MIT)
The documentation blocks within this file are licensed under the Creative Commons Attribution 4.0 International License (CC BY 4.0).
SPDX-License-Identifier: CC-BY-4.0
c23_nodiscard infix_executable_t infix_executable_alloc | ( | size_t | size | ) |
Allocates a page-aligned block of W^X-compliant executable memory.
void infix_executable_free | ( | infix_executable_t | exec | ) |
Frees executable memory, creating a guard page to prevent use-after-free.
c23_nodiscard bool infix_executable_make_executable | ( | infix_executable_t | exec | ) |
Makes a JIT memory region readable and executable (and non-writable).
void infix_internal_dispatch_callback_fn_impl | ( | infix_reverse_t * | context, |
void * | return_value_ptr, | ||
void ** | args_array | ||
) |
The high-level C dispatcher function called by reverse trampoline stubs.
c23_nodiscard infix_protected_t infix_protected_alloc | ( | size_t | size | ) |
Allocates a page-aligned block of data memory.
void infix_protected_free | ( | infix_protected_t | prot | ) |
Frees a block of protected data memory.
c23_nodiscard bool infix_protected_make_readonly | ( | infix_protected_t | prot | ) |
Hardens a block of protected data memory to be read-only.
|
static |