This example demonstrates undefined behavior caused by mismatched memory allocators between Rust and C++.
- Rust allocates memory using
Box - Ownership is transferred to C++
- C++ deallocates using
operator delete
Different allocators may use different metadata layouts.
Deallocating with the wrong allocator leads to undefined behavior.
./run.sh