Improvements
This commit is contained in:
parent
15a56ed34a
commit
f4043b9cd0
1 changed files with 4 additions and 8 deletions
|
@ -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 {
|
||||||
|
|
Loading…
Reference in a new issue