summaryrefslogtreecommitdiffstats
path: root/src/core/templates.h
diff options
context:
space:
mode:
authoreray orçunus <erayorcunus@gmail.com>2020-01-10 23:48:05 +0100
committereray orçunus <erayorcunus@gmail.com>2020-01-10 23:48:05 +0100
commit8a745e4d89241c4415e934bbc6aaca057a83b64c (patch)
tree875c785cba605a4ed899e2d8de2a3d27b20dbc57 /src/core/templates.h
parentMerge pull request #287 from Sergeanur/LastDarkel (diff)
downloadre3-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.h9
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++;