[Commits] 1020d56: Better and more correct comment.

Jan Lindström jan.lindstrom at mariadb.com
Wed Mar 18 15:17:52 EET 2015


revision-id: 1020d569343aab2de2a96cf630f3e7d9fa7ca84f
parent(s): 2bdbfd334bba93f75b2952e8e76f20ed29fb2bd4
committer: Jan Lindström
branch nick: 10.0-git
timestamp: 2015-03-18 15:17:17 +0200
message:

Better and more correct comment.

---
 storage/innobase/sync/sync0sync.cc | 10 ++++++++--
 storage/xtradb/sync/sync0sync.cc   | 10 ++++++++--
 2 files changed, 16 insertions(+), 4 deletions(-)

diff --git a/storage/innobase/sync/sync0sync.cc b/storage/innobase/sync/sync0sync.cc
index 2928fb0..7225ac1 100644
--- a/storage/innobase/sync/sync0sync.cc
+++ b/storage/innobase/sync/sync0sync.cc
@@ -47,14 +47,20 @@ Created 9/5/1995 Heikki Tuuri
 #include "ha_prototypes.h"
 #include "my_cpu.h"
 
-/* There is a bug in Visual Studio 2010
+/* There is a bug in Visual Studio 2010.
 Visual Studio has a feature "Checked Iterators". In a debug build, every
-iterator operation is checked at runtime for errors, e g, out of range.
+iterator operation is checked at runtime for errors, e.g., out of range.
+Because of bug there is runtime error on following code
+for (std::vector<sync_level_t>::iterator it = array->elems.begin(); it !=
+array->elems.end(); ++it) and runtime check fails on comparison
+it != array->elems.end() that is correct and standard way to do end
+of range comparison.
 Disable this "Checked Iterators" for Windows and Debug if defined.
 */
 #ifdef UNIV_DEBUG
 #ifdef __WIN__
 #ifdef _ITERATOR_DEBUG_LEVEL
+#undef  _ITERATOR_DEBUG_LEVEL
 #define _ITERATOR_DEBUG_LEVEL 0
 #endif /* _ITERATOR_DEBUG_LEVEL */
 #endif /* __WIN__*/
diff --git a/storage/xtradb/sync/sync0sync.cc b/storage/xtradb/sync/sync0sync.cc
index b876669..131aa71 100644
--- a/storage/xtradb/sync/sync0sync.cc
+++ b/storage/xtradb/sync/sync0sync.cc
@@ -48,14 +48,20 @@ Created 9/5/1995 Heikki Tuuri
 #include "ha_prototypes.h"
 #include "my_cpu.h"
 
-/* There is a bug in Visual Studio 2010
+/* There is a bug in Visual Studio 2010.
 Visual Studio has a feature "Checked Iterators". In a debug build, every
-iterator operation is checked at runtime for errors, e g, out of range.
+iterator operation is checked at runtime for errors, e.g., out of range.
+Because of bug there is runtime error on following code
+for (std::vector<sync_level_t>::iterator it = array->elems.begin(); it !=
+array->elems.end(); ++it) and runtime check fails on comparison
+it != array->elems.end() that is correct and standard way to do end
+of range comparison.
 Disable this "Checked Iterators" for Windows and Debug if defined.
 */
 #ifdef UNIV_DEBUG
 #ifdef __WIN__
 #ifdef _ITERATOR_DEBUG_LEVEL
+#undef  _ITERATOR_DEBUG_LEVEL
 #define _ITERATOR_DEBUG_LEVEL 0
 #endif /* _ITERATOR_DEBUG_LEVEL */
 #endif /* __WIN__*/


More information about the commits mailing list