[PATCH] Bounds check only if POOMA_BOUNDS_CHECK
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH] Bounds check only if POOMA_BOUNDS_CHECK
- To: pooma-dev@xxxxxxxxxxxxxxxxxxxxxx, "Jeffrey D. Oldham" <oldham@xxxxxxxxxxxxxxxx>
- Subject: [PATCH] Bounds check only if POOMA_BOUNDS_CHECK
- From: Richard Guenther <rguenth@xxxxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Thu, 19 Aug 2004 23:17:23 +0200
This patch disables GuardLayers boundschecking if not configured with
bounds checking on.
Ok?
Richard.
2004Aug19 Richard Guenther <richard.guenther@xxxxxxxxxxxxxxxx>
* src/Layout/GuardLayers.h: disable bounds-checking if not
POOMA_BOUNDS_CHECK.
Index: src/Layout/GuardLayers.h
===================================================================
RCS file: /home/pooma/Repository/r2/src/Layout/GuardLayers.h,v
retrieving revision 1.10
diff -u -u -r1.10 GuardLayers.h
--- src/Layout/GuardLayers.h 26 Oct 2003 11:28:11 -0000 1.10
+++ src/Layout/GuardLayers.h 19 Aug 2004 21:15:39 -0000
@@ -123,12 +123,16 @@
int lower(int i) const
{
+#if POOMA_BOUNDS_CHECK
PInsist(i<Dim&&i>=0," GuardLayers index out of range ");
+#endif
return lower_m[i];
}
int upper(int i) const
{
+#if POOMA_BOUNDS_CHECK
PInsist(i<Dim&&i>=0," GuardLayers index out of range ");
+#endif
return upper_m[i];
}
@@ -138,12 +142,16 @@
int &lower(int i)
{
+#if POOMA_BOUNDS_CHECK
PInsist(i<Dim&&i>=0," GuardLayers index out of range ");
+#endif
return lower_m[i];
}
int &upper(int i)
{
+#if POOMA_BOUNDS_CHECK
PInsist(i<Dim&&i>=0," GuardLayers index out of range ");
+#endif
return upper_m[i];
}