-
Notifications
You must be signed in to change notification settings - Fork 74
Description
Description:
The cuCIM plugin interface currently uses opaque void* pointers to pass C++ objects (e.g., std::unique_ptr<std::vector<>>) across plugin boundaries. While this maintains a C-compatible struct definition, the underlying C++ objects still require the same C++ ABI and STL implementation on both sides of the boundary.
Problem:
Passing C++ objects as void* does not fully protect against ABI incompatibilities. If plugins are compiled with different compiler versions or STL implementations, the C++ object representation may differ, leading to potential runtime issues — even though the interface appears C-compatible.
Proposed improvement:
Refactor cross-plugin data structures to use pure C types (e.g., plain C arrays, cuCIM-defined structs) instead of hiding C++ types behind void*. This would provide true ABI stability and enable:
-compatibility across different compiler versions
-support for third-party plugins built with different toolchains
-potential for bindings to other languages (C, Python FFI, etc.)
Trade-offs:
-larger architectural change
-less convenient than direct C++ object passing
-current approach works reliably within cuCIM's controlled build environment (same GCC version, same STL)