1
0
Fork 0
mirror of https://github.com/beefytech/Beef.git synced 2025-06-10 04:22:20 +02:00

Improved hotswapping with extension modules

This commit is contained in:
Brian Fiete 2024-12-29 11:02:17 -08:00
parent 769036584a
commit fd4fd43ce3
19 changed files with 836 additions and 232 deletions

View file

@ -6,7 +6,7 @@
NS_BF_BEGIN;
template <typename T, typename TAlloc = AllocatorCLib<T> >
template <typename T, typename TAlloc = AllocatorCLib >
class SizedArrayBase : protected TAlloc
{
public:
@ -378,7 +378,7 @@ protected:
void Grow(intptr newSize)
{
T* newVals = TAlloc::allocate(newSize);
T* newVals = TAlloc::allocate<T>(newSize);
if (this->mVals != NULL)
{
if (this->mSize > 0)
@ -533,7 +533,7 @@ public:
{
intptr newSize = this->mAllocSize + this->mAllocSize / 2 + 1;
T* newVals = TAlloc::allocate(newSize);
T* newVals = TAlloc::allocate<T>(newSize);
if (this->mVals != NULL)
{
if (idx > 0) // Copy left of idx
@ -562,7 +562,7 @@ public:
{
intptr newSize = BF_MAX(this->mSize + size, this->mAllocSize + this->mAllocSize / 2 + 1);
T* newVals = TAlloc::allocate(newSize);
T* newVals = TAlloc::allocate<T>(newSize);
if (this->mVals != NULL)
{
if (idx > 0) // Copy left of idx
@ -638,7 +638,7 @@ public:
protected:
void Grow(intptr newSize)
{
T* newVals = TAlloc::allocate(newSize);
T* newVals = TAlloc::allocate<T>(newSize);
if (this->mVals != NULL)
{
if (this->mSize > 0)
@ -761,7 +761,7 @@ public:
{
intptr newSize = this->mAllocSize + this->mAllocSize / 2 + 1;
T* newVals = TAlloc::allocate(newSize);
T* newVals = TAlloc::allocate<T>(newSize);
if (this->mVals != NULL)
{
if (idx > 0) // Copy left of idx
@ -790,7 +790,7 @@ public:
{
intptr newSize = BF_MAX(this->mSize + size, this->mAllocSize + this->mAllocSize / 2 + 1);
T* newVals = TAlloc::allocate(newSize);
T* newVals = TAlloc::allocate<T>(newSize);
if (this->mVals != NULL)
{
if (idx > 0) // Copy left of idx
@ -854,14 +854,14 @@ public:
}
};
template <typename T, typename TAlloc = AllocatorCLib<T> >
template <typename T, typename TAlloc = AllocatorCLib >
class SizedArrayImpl : public SizedArrayBaseT<T, TAlloc, std::is_pod<T>::value>
{
public:
typedef SizedArrayBaseT<T, TAlloc, std::is_pod<T>::value> _Base;
};
template <typename T, int TInternalSize, typename TAlloc = AllocatorCLib<T> >
template <typename T, int TInternalSize, typename TAlloc = AllocatorCLib >
class SizedArray : public SizedArrayImpl<T, TAlloc>
{
public: