1
0
Fork 0
mirror of https://github.com/beefytech/Beef.git synced 2025-07-04 15:26:00 +02:00

Compiler performance enhancements

This commit is contained in:
Brian Fiete 2022-05-06 11:28:38 -07:00
parent 3736281ff7
commit d623c21495
22 changed files with 679 additions and 291 deletions

View file

@ -1,6 +1,6 @@
#pragma once
#include "../Common.h"
#include "Array.h"
#include <unordered_map>
#define NEW_DICTIONAY
@ -9,8 +9,8 @@ NS_BF_BEGIN;
#ifdef NEW_DICTIONAY
template <typename TKey, typename TValue>
class Dictionary
template <typename TKey, typename TValue, typename TAlloc = AllocatorCLib<TKey> >
class Dictionary : public TAlloc
{
public:
typedef int int_cosize;
@ -411,7 +411,7 @@ public:
void AllocData(intptr size, Entry*& outEntries, int_cosize*& outBuckets)
{
uint8* data = new uint8[size * (sizeof(Entry) + sizeof(int_cosize))];
uint8* data = (uint8*)this->rawAllocate(size * (sizeof(Entry) + sizeof(int_cosize)));
outEntries = (Entry*)data;
outBuckets = (int_cosize*)(data + size * sizeof(Entry));
}
@ -436,7 +436,7 @@ public:
}
}
delete [] mEntries;
this->rawDeallocate(mEntries);
}
Dictionary& operator=(const Dictionary& rhs)