Skip to content

Commit 1020d56

Browse files
author
Jan Lindström
committed
Better and more correct comment.
1 parent 2bdbfd3 commit 1020d56

File tree

2 files changed

+16
-4
lines changed

2 files changed

+16
-4
lines changed

storage/innobase/sync/sync0sync.cc

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,14 +47,20 @@ Created 9/5/1995 Heikki Tuuri
4747
#include "ha_prototypes.h"
4848
#include "my_cpu.h"
4949

50-
/* There is a bug in Visual Studio 2010
50+
/* There is a bug in Visual Studio 2010.
5151
Visual Studio has a feature "Checked Iterators". In a debug build, every
52-
iterator operation is checked at runtime for errors, e g, out of range.
52+
iterator operation is checked at runtime for errors, e.g., out of range.
53+
Because of bug there is runtime error on following code
54+
for (std::vector<sync_level_t>::iterator it = array->elems.begin(); it !=
55+
array->elems.end(); ++it) and runtime check fails on comparison
56+
it != array->elems.end() that is correct and standard way to do end
57+
of range comparison.
5358
Disable this "Checked Iterators" for Windows and Debug if defined.
5459
*/
5560
#ifdef UNIV_DEBUG
5661
#ifdef __WIN__
5762
#ifdef _ITERATOR_DEBUG_LEVEL
63+
#undef _ITERATOR_DEBUG_LEVEL
5864
#define _ITERATOR_DEBUG_LEVEL 0
5965
#endif /* _ITERATOR_DEBUG_LEVEL */
6066
#endif /* __WIN__*/

storage/xtradb/sync/sync0sync.cc

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,14 +48,20 @@ Created 9/5/1995 Heikki Tuuri
4848
#include "ha_prototypes.h"
4949
#include "my_cpu.h"
5050

51-
/* There is a bug in Visual Studio 2010
51+
/* There is a bug in Visual Studio 2010.
5252
Visual Studio has a feature "Checked Iterators". In a debug build, every
53-
iterator operation is checked at runtime for errors, e g, out of range.
53+
iterator operation is checked at runtime for errors, e.g., out of range.
54+
Because of bug there is runtime error on following code
55+
for (std::vector<sync_level_t>::iterator it = array->elems.begin(); it !=
56+
array->elems.end(); ++it) and runtime check fails on comparison
57+
it != array->elems.end() that is correct and standard way to do end
58+
of range comparison.
5459
Disable this "Checked Iterators" for Windows and Debug if defined.
5560
*/
5661
#ifdef UNIV_DEBUG
5762
#ifdef __WIN__
5863
#ifdef _ITERATOR_DEBUG_LEVEL
64+
#undef _ITERATOR_DEBUG_LEVEL
5965
#define _ITERATOR_DEBUG_LEVEL 0
6066
#endif /* _ITERATOR_DEBUG_LEVEL */
6167
#endif /* __WIN__*/

0 commit comments

Comments
 (0)