From d42d218a3685c030a7370d30f2de5495ea526d99 Mon Sep 17 00:00:00 2001 From: aura Date: Fri, 13 Mar 2026 05:03:12 +0100 Subject: wip on props --- src/util/allocator.h | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'src/util/allocator.h') diff --git a/src/util/allocator.h b/src/util/allocator.h index 8b159da..0cb8fa2 100644 --- a/src/util/allocator.h +++ b/src/util/allocator.h @@ -83,7 +83,10 @@ struct LIST { capacity = _size; } + LIST( const LIST& other ) { + if( this == &other ) return; + if( !other.capacity || !other.size ) { capacity = 1; size = 0; @@ -108,8 +111,13 @@ struct LIST { if( this == &other ) return *this; - if( data && data != other.data ) + if( data && data != other.data ) { + if constexpr( !__is_trivially_destructible(T) ) { + for( U32 i = 0; i < size; i++ ) + data[i].~T(); + } free( data ); + } data = 0; @@ -142,6 +150,8 @@ struct LIST { } if( data ) free( data ); + size = 0; + data = 0; } T at( U32 index ) { -- cgit v1.2.3