-Changed memory functions, Memory::alloc_static*, simplified them, made them aligned to 16

-Changed Vector<> template to fit this.
This commit is contained in:
Juan Linietsky 2017-01-06 10:15:44 -03:00
parent 99ceddd11e
commit 53ce643e52
18 changed files with 340 additions and 1125 deletions

View file

@ -604,7 +604,7 @@ void PoolAllocator::create_pool(void * p_mem,int p_size,int p_max_entries) {
PoolAllocator::PoolAllocator(int p_size,bool p_needs_locking,int p_max_entries) {
mem_ptr=Memory::alloc_static( p_size,"PoolAllocator()");
mem_ptr=memalloc( p_size);
ERR_FAIL_COND(!mem_ptr);
align=1;
create_pool(mem_ptr,p_size,p_max_entries);
@ -648,7 +648,7 @@ PoolAllocator::PoolAllocator(int p_align,int p_size,bool p_needs_locking,int p_m
PoolAllocator::~PoolAllocator() {
if (mem_ptr)
Memory::free_static( mem_ptr );
memfree( mem_ptr );
memdelete_arr( entry_array );
memdelete_arr( entry_indices );