You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* Use ptr::write when writing uninitialized memory
* Use smaller unsafe blocks
* Rust BindData/InitData can just use Rust types
* Use unsafe blocks inside unsafe fns generated by macro
This will prevent the macro generating a warning in edition 2024
* Fix unused import
* Better safety docs for vtab methods
Contrary to the previous docs, the instances passed to these functions are *not* initialized by the caller. Rather, the called function is responsible for writing into uninitialized memory.
* Similar safety fixes in vtab tests
* VTab::bind and init are now safe
Rather than passing a pointer to a block of uninitialized memory, which can easily lead to UB, these functions now just return Rust objects.
This improves #414 by reducing the amount of unsafe code needed from extensions.
* vtab::Free is no longer needed
BindInfo and InitInfo will be dropped in the usual way when freed by duckdb core. Any necessary destructors can be in Drop impls.
* BindData and InitData should be Send+Sync
It's not completely clear but it looks like the engine could run the table fn from multiple threads, so requiring this seems safer
* Add a safe & typed interface to get bind_data
* Also safely retrieve the init_data
* Add unsafe blocks, rm unnecessary cast
* clippy
---------
Co-authored-by: Martin Pool <[email protected]>
0 commit comments