infix
A JIT-Powered FFI Library for C
Loading...
Searching...
No Matches
Ch02_LargeStruct.c File Reference

Cookbook Chapter 2: Large Structs Passed by Reference. More...

#include <infix/infix.h>
#include <stdio.h>
Include dependency graph for Ch02_LargeStruct.c:

Classes

struct  LargeStruct
 A struct larger than 16 bytes, guaranteed to be passed by reference on most ABIs. More...
 

Functions

static int get_first_element (LargeStruct s)
 
int main ()
 

Detailed Description

Cookbook Chapter 2: Large Structs Passed by Reference.

This example demonstrates how infix handles structs that are too large to fit in registers. The C ABI specifies that such structs are passed by reference (i.e., a pointer to the struct is passed) or on the stack. From the infix user's perspective, the signature and call process are identical to a small struct; the library's ABI logic automatically handles the correct passing convention.

Function Documentation

◆ get_first_element()

static int get_first_element ( LargeStruct  s)
static

◆ main()

int main ( void  )