| 1 | #ifndef VILE_NATIVE_ABI_H |
| 2 | #define VILE_NATIVE_ABI_H |
| 3 | #include <stdint.h> |
| 4 | typedef struct VileNativeValue {int64_t x;int64_t k;} VileNativeValue; |
| 5 | /* The importer and generated code access the same private pool objects. */ |
| 6 | typedef struct VileNativePair { |
| 7 | int64_t car; |
| 8 | struct VileNativePair *cdr; |
| 9 | } VileNativePair; |
| 10 | _Static_assert(sizeof(VileNativePair)==16,"native private pair layout"); |
| 11 | /* Original handles stay in the invocation's C stack frame, visible to a |
| 12 | * conservative collector even while generated code has overwritten a cell. */ |
| 13 | typedef struct VileNativeVectorWrite { |
| 14 | void *vector; |
| 15 | int64_t index; |
| 16 | uint64_t original[2]; |
| 17 | } VileNativeVectorWrite; |
| 18 | typedef struct VileNativeVectorJournal { |
| 19 | VileNativeVectorWrite *entries; |
| 20 | int64_t count,capacity; |
| 21 | } VileNativeVectorJournal; |
| 22 | typedef struct VileNativeHostApi { |
| 23 | void *context; |
| 24 | void (*vector)(void*,VileNativeVectorJournal*,int64_t,VileNativeValue*,int64_t,VileNativeValue*); |
| 25 | void (*finish)(void*,VileNativeVectorJournal*,VileNativeValue*); |
| 26 | } VileNativeHostApi; |
| 27 | #endif |
| 28 | |