Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Select ctypes primitives at runtime #757

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Commits on Oct 30, 2023

  1. Select ctypes primitives at runtime

    Executing a program that uses `ocaml-ctypes` on a different platform from where
    the OCaml code was compiled can result in memory errors due to the wrong pointer
    arithmetic. For example, when a program is compiled on a 64-bit machine to OCaml
    bytecode and the bytecode is subsequently compiled to 32-bit WebAssembly (Wasm)
    code, `ocaml-types` uses 64-bit pointer arithmetic on a 32-bit architecture.
    
    This commit makes the C data model selectable using an environment variable,
    i.e., `CTYPES_DATA_MODEL=ILP32` for 32-bit Wasm. The data model can be selected
    during compilation or during runtime.
    benozol committed Oct 30, 2023
    Configuration menu
    Copy the full SHA
    c29edd4 View commit details
    Browse the repository at this point in the history