Various improvement to memory management and API

[module]: added enum for backend
[VecZnx, VecZnxDft, VecZnxBig, VmpPMat]: added ptr to data
[VecZnxBorrow]: removed
[VecZnxAPI]: removed
This commit is contained in:
Jean-Philippe Bossuat
2025-03-17 12:07:40 +01:00
parent 97a1559bf2
commit 46c577409e
28 changed files with 896 additions and 1064 deletions

View File

@@ -8,7 +8,6 @@ pub mod encoding;
)]
// Other modules and exports
pub mod ffi;
pub mod free;
pub mod infos;
pub mod module;
pub mod sampling;
@@ -20,7 +19,6 @@ pub mod vec_znx_dft;
pub mod vmp;
pub use encoding::*;
pub use free::*;
pub use infos::*;
pub use module::*;
pub use sampling::*;
@@ -124,11 +122,3 @@ pub fn alloc_aligned_custom<T>(size: usize, align: usize) -> Vec<T> {
pub fn alloc_aligned<T>(size: usize) -> Vec<T> {
alloc_aligned_custom::<T>(size, DEFAULTALIGN)
}
fn alias_mut_slice_to_vec<T>(slice: &[T]) -> Vec<T> {
unsafe {
let ptr: *mut T = slice.as_ptr() as *mut T;
let len: usize = slice.len();
Vec::from_raw_parts(ptr, len, len)
}
}