diff options
author | eray orçunus <erayorcunus@gmail.com> | 2020-01-10 23:48:05 +0100 |
---|---|---|
committer | eray orçunus <erayorcunus@gmail.com> | 2020-01-10 23:48:05 +0100 |
commit | 8a745e4d89241c4415e934bbc6aaca057a83b64c (patch) | |
tree | 875c785cba605a4ed899e2d8de2a3d27b20dbc57 /src/core/templates.h | |
parent | Merge pull request #287 from Sergeanur/LastDarkel (diff) | |
download | re3-8a745e4d89241c4415e934bbc6aaca057a83b64c.tar re3-8a745e4d89241c4415e934bbc6aaca057a83b64c.tar.gz re3-8a745e4d89241c4415e934bbc6aaca057a83b64c.tar.bz2 re3-8a745e4d89241c4415e934bbc6aaca057a83b64c.tar.lz re3-8a745e4d89241c4415e934bbc6aaca057a83b64c.tar.xz re3-8a745e4d89241c4415e934bbc6aaca057a83b64c.tar.zst re3-8a745e4d89241c4415e934bbc6aaca057a83b64c.zip |
Diffstat (limited to 'src/core/templates.h')
-rw-r--r-- | src/core/templates.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/core/templates.h b/src/core/templates.h index f785d647..a1627357 100644 --- a/src/core/templates.h +++ b/src/core/templates.h @@ -61,12 +61,21 @@ public: T *New(void){ bool wrapped = false; do +#ifdef FIX_BUGS + if (++m_allocPtr >= m_size) { + m_allocPtr = 0; + if (wrapped) + return nil; + wrapped = true; + } +#else if(++m_allocPtr == m_size){ if(wrapped) return nil; wrapped = true; m_allocPtr = 0; } +#endif while(!m_flags[m_allocPtr].free); m_flags[m_allocPtr].free = 0; m_flags[m_allocPtr].id++; |