Improvements

This commit is contained in:
xavo95 2025-01-12 19:45:29 +01:00
parent 15a56ed34a
commit f4043b9cd0
Signed by: xavo95
GPG key ID: CBF8ADED6DEBB783

View file

@ -15,10 +15,10 @@ type TArrayResize = fn(ptr: usize, len: u32);
static T_ARRAY_RESIZE_GROW: OnceLock<usize> = OnceLock::new(); static T_ARRAY_RESIZE_GROW: OnceLock<usize> = OnceLock::new();
pub struct TArray { pub struct TArray {
pub(crate) ptr: *const u8, pub ptr: *const u8,
pub(crate) data_ptr: u64, pub data_ptr: u64,
pub(crate) len: u32, pub len: u32,
pub(crate) cap: u32, pub cap: u32,
} }
impl TArray { impl TArray {
@ -36,10 +36,6 @@ impl TArray {
} }
} }
pub fn capacity(&self) -> u32 {
self.cap
}
pub fn clear(&mut self) { pub fn clear(&mut self) {
if self.data_ptr != 0 && self.len > 0 { if self.data_ptr != 0 && self.len > 0 {
let data = unsafe { let data = unsafe {