Using layout-compatible types means simple fields can be access directly from a foreign language, improving performance.
C++ Language or Library Changes
Add a function to get the allocation metadata given a new’d pointer, like I can get from delete.
This is useful for custom allocators.
Existing Work
Crubit currently does this for:
- C++ (string_view, span, optional, vector, unique_ptr, shared_ptr)
- Rust (everything non-generic type plus Option + Result + slices)
Using layout-compatible types means simple fields can be access directly from a foreign language, improving performance.
C++ Language or Library Changes
Add a function to get the allocation metadata given a
new’d pointer, like I can get fromdelete.This is useful for custom allocators.
Existing Work
Crubit currently does this for: