Hold every declaration to a symbol MEOS exports - #21
Merged
estebanzimanyi merged 1 commit intoSep 2, 2026
Merged
Conversation
A P/Invoke binds by name at the first call, so a function MEOS renames or drops is invisible to the compiler and reaches a caller as an `EntryPointNotFoundException` in production. A test resolves every entry point the binding declares against the loaded library, which turns that into one named failure with the symbols listed. It reads the declarations by reflection over the `LibraryImport` attributes rather than from a list beside them, so a declaration cannot escape it, and it refuses a run that reads fewer than a thousand of them, since a parity check with nothing in its hand accepts anything. A second test holds the check itself to a control: `meos_initialize` resolves and `meos_no_such_function` does not. Under that check the binding declares MEOS's own surface. The catalog marks the declarations that reach it from a project MEOS vendors — pgPointCloud's `pc_api.h` and `hashtable.h`, PostgreSQL's `pg_numeric.h` — and those are that project's API rather than MEOS's: 150 declarations, every one of them internal, and `indexFor`, `pc_patch_sort` and `pc_patch_is_sorted` among them are the only three in the whole catalog that the built library never exports, the first because a `static inline` in a header defines no external symbol at all. The remaining 4675 functions across 26 headers each resolve.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A P/Invoke binds by name at the first call, so a function MEOS renames or
drops is invisible to the compiler and reaches a caller as an
EntryPointNotFoundExceptionin production. A test resolves every entry pointthe binding declares against the loaded library, which turns that into one
named failure with the symbols listed. It reads the declarations by reflection
over the
LibraryImportattributes rather than from a list beside them, so adeclaration cannot escape it, and it refuses a run that reads fewer than a
thousand of them, since a parity check with nothing in its hand accepts
anything. A second test holds the check itself to a control:
meos_initializeresolves and
meos_no_such_functiondoes not.Under that check the binding declares MEOS's own surface. The catalog marks
the declarations that reach it from a project MEOS vendors — pgPointCloud's
pc_api.handhashtable.h, PostgreSQL'spg_numeric.h— and those are thatproject's API rather than MEOS's: 150 declarations, every one of them internal,
and
indexFor,pc_patch_sortandpc_patch_is_sortedamong them are theonly three in the whole catalog that the built library never exports, the first
because a
static inlinein a header defines no external symbol at all. Theremaining 4675 functions across 26 headers each resolve.