Skip to content

Bind a MEOS scalar at the width its ABI defines - #12

Merged
estebanzimanyi merged 1 commit into
MobilityDB:mainfrom
estebanzimanyi:fix/scalar-abi-width
Sep 2, 2026
Merged

estebanzimanyi merged 1 commit into
MobilityDB:mainfrom
estebanzimanyi:fix/scalar-abi-width

Conversation

@estebanzimanyi

Copy link
Copy Markdown
Member

A C type the mapping table does not name falls through to IntPtr, the
pointer-width opaque handle. The _t spellings libclang leaves unreduced
— int8_t through uint64_t — and unsigned char are absent from that
table, so 530 of the 4825 bound functions declared a scalar at pointer
width: 246 int64_t, 140 uint64_t, 38 uint32_t and 24 unsigned char
arguments, and 72 int64_t, 58 uint64_t, 56 uint32_t and one unsigned char
returns. A uint32_t returned as IntPtr reads eight bytes of a register the
ABI defines four of, so the value carries whatever the upper half held.

The enum types come from the catalog's own enums rather than from names
listed one at a time. The five listed names covered MeosType, interpType
and tempSubtype, missed IndexSearchOp, SPTreeKind, MeosPixType, MeosOper,
SkipListType and nullHandleType across 43 further parameters and returns,
and one of them — spanType — names no catalog enum at all. Reading the set
from the catalog is what keeps the next enum from arriving as a pointer.

A C type the mapping table does not name falls through to IntPtr, the
pointer-width opaque handle. The `_t` spellings libclang leaves unreduced
— int8_t through uint64_t — and `unsigned char` are absent from that
table, so 530 of the 4825 bound functions declared a scalar at pointer
width: 246 int64_t, 140 uint64_t, 38 uint32_t and 24 unsigned char
arguments, and 72 int64_t, 58 uint64_t, 56 uint32_t and one unsigned char
returns. A uint32_t returned as IntPtr reads eight bytes of a register the
ABI defines four of, so the value carries whatever the upper half held.

The enum types come from the catalog's own `enums` rather than from names
listed one at a time. The five listed names covered MeosType, interpType
and tempSubtype, missed IndexSearchOp, SPTreeKind, MeosPixType, MeosOper,
SkipListType and nullHandleType across 43 further parameters and returns,
and one of them — spanType — names no catalog enum at all. Reading the set
from the catalog is what keeps the next enum from arriving as a pointer.
@estebanzimanyi
estebanzimanyi merged commit 73b6864 into MobilityDB:main Sep 2, 2026
1 check passed
@estebanzimanyi
estebanzimanyi deleted the fix/scalar-abi-width branch September 2, 2026 20:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant