Open brson opened 8 months ago
Seems like there are two parts to it
For step#1.
Comparing all the files.
ls sui/external-crates/move/crates/move-stdlib/src/natives/
bcs.rs debug.rs hash.rs helpers.rs mod.rs signer.rs string.rs type_name.rs unit_test.rs vector.rs
ls move/language/move-stdlib/src/natives/
bcs.rs event.rs helpers.rs signer.rs type_name.rs vector.rs
debug.rs hash.rs mod.rs string.rs unit_test.rs
Seems like move/move-stdlib has one extra file event.rs
Comparing for presence of methods in these files. Methods should at least have the same signature.
There are two native functions that are absent in move-language/move(after checking out @brson's updated branch)
// from crates/mysten-util-mem/src/allocators.rs
// Linux/BSD call system allocator (currently malloc).
pub unsafe extern "C" fn malloc_usable_size(_ptr: *const c_void) -> usize
// from crates/mysten-util-mem/src/malloc_size.rs
pub type VoidPtrToSizeFn = unsafe extern "C" fn(ptr: *const c_void) -> usize
This is used for calling size_of for various allocations. All the various size_of implementations are in https://github.com/MystenLabs/sui/tree/main/crates/mysten-util-mem.
Do we still want to implement(import) them in move-native?
We are in the process of migrating to the sui codebase. There are likely new native function calls on sui that we do not implement, either in
std
or in their ownsui
library.Look into this and see what we need to add to
move-native
to make this work.If there are natives called by
sui
directly they should probably live in a newsui
module inside ofmove-native
, as the calls used bystd
live in a correspondingstd
module.