From 7b72219bf4fd6d52a2e47cea09c3241556194908 Mon Sep 17 00:00:00 2001 From: Deukhoofd Date: Sun, 6 Mar 2022 10:59:46 +0100 Subject: [PATCH] Increase max ref count --- angelscript/source/as_atomic.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/angelscript/source/as_atomic.cpp b/angelscript/source/as_atomic.cpp index e110b3f..718f04e 100644 --- a/angelscript/source/as_atomic.cpp +++ b/angelscript/source/as_atomic.cpp @@ -37,6 +37,7 @@ #include "as_atomic.h" BEGIN_AS_NAMESPACE +const asUINT MAX_VALUE = 100000000; asCAtomic::asCAtomic() { @@ -47,7 +48,7 @@ asDWORD asCAtomic::get() const { // A very high ref count is highly unlikely. It most likely a problem with // memory that has been overwritten or is being accessed after it was deleted. - asASSERT(value < 1000000); + asASSERT(value < MAX_VALUE); return value; } @@ -56,7 +57,7 @@ void asCAtomic::set(asDWORD val) { // A very high ref count is highly unlikely. It most likely a problem with // memory that has been overwritten or is being accessed after it was deleted. - asASSERT(value < 1000000); + asASSERT(value < MAX_VALUE); value = val; } @@ -65,7 +66,7 @@ asDWORD asCAtomic::atomicInc() { // A very high ref count is highly unlikely. It most likely a problem with // memory that has been overwritten or is being accessed after it was deleted. - asASSERT(value < 1000000); + asASSERT(value < MAX_VALUE); return asAtomicInc((int&)value); } @@ -74,7 +75,7 @@ asDWORD asCAtomic::atomicDec() { // A very high ref count is highly unlikely. It most likely a problem with // memory that has been overwritten or is being accessed after it was deleted. - asASSERT(value < 1000000); + asASSERT(value < MAX_VALUE); return asAtomicDec((int&)value); }