Revrert "Enable assert alwayd in Dali::Vector" 87/275587/3
authorEunki, Hong <eunkiki.hong@samsung.com>
Thu, 26 May 2022 16:46:38 +0000 (01:46 +0900)
committerEunki Hong <eunkiki.hong@samsung.com>
Fri, 27 May 2022 01:06:27 +0000 (01:06 +0000)
Due to the DALI_ASSERT_ALWAYS, Dali::Vector try to check
the range of index every times.
It might make some performance reducing.

Change-Id: I2fdcf435bda147f9ea102c3106cb44f0772a4899
Signed-off-by: Eunki, Hong <eunkiki.hong@samsung.com>
automated-tests/src/dali/utc-Dali-CircularQueue.cpp
automated-tests/src/dali/utc-Dali-Vector.cpp
dali/public-api/common/dali-vector.h

index e5c718c..881e29d 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2021 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2022 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -15,6 +15,8 @@
  *
  */
 
+#define ENABLE_VECTOR_ASSERTS
+
 #include <dali-test-suite-utils.h>
 #include <dali/devel-api/common/circular-queue.h>
 #include <dali/public-api/dali-core.h>
index 815cf69..b6ae5bd 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2021 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2022 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -15,6 +15,8 @@
  *
  */
 
+#define ENABLE_VECTOR_ASSERTS
+
 #include <dali-test-suite-utils.h>
 #include <dali/public-api/dali-core.h>
 #include <stdlib.h>
index 80c6364..5bdccc1 100644 (file)
@@ -2,7 +2,7 @@
 #define DALI_VECTOR_H
 
 /*
- * Copyright (c) 2021 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2022 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
 #include <dali/public-api/common/type-traits.h>
 #include <dali/public-api/math/math-utils.h>
 
+/**
+ * @brief For DALi internal use, asserts are enabled in debug builds.
+ *
+ * For Application use, asserts can be enabled manually.
+ * @SINCE_2_1.23
+ */
+#if defined(DEBUG_ENABLED)
+#define ENABLE_VECTOR_ASSERTS
+#endif
+
+#if defined(ENABLE_VECTOR_ASSERTS)
 #define DALI_ASSERT_VECTOR(cond) DALI_ASSERT_ALWAYS(cond)
+#else
+#define DALI_ASSERT_VECTOR(cond)
+#endif
 
 namespace Dali
 {