summaryrefslogtreecommitdiffstats
path: root/libglusterfs/src/common-utils.h
diff options
context:
space:
mode:
authorVijay Bellur <vijay@gluster.com>2011-02-21 12:11:59 +0000
committerAnand V. Avati <avati@dev.gluster.com>2011-02-21 10:24:47 -0800
commit2795f3e03a299daf88e3172b068511d41c493247 (patch)
tree89d98fe83a7e3b30a21fffb218ec3c4cbbae9e51 /libglusterfs/src/common-utils.h
parentc47961cc18f7bbc1b46e1cdf5662b8ec409065e5 (diff)
libglusterfs: Enable assert() and memory accounting with DEBUG
Signed-off-by: Vijay Bellur <vijay@gluster.com> Signed-off-by: Anand V. Avati <avati@dev.gluster.com> BUG: 2447 (Enable assert () and memory accounting with DEBUG) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=2447
Diffstat (limited to 'libglusterfs/src/common-utils.h')
-rw-r--r--libglusterfs/src/common-utils.h10
1 files changed, 7 insertions, 3 deletions
diff --git a/libglusterfs/src/common-utils.h b/libglusterfs/src/common-utils.h
index ec14919b410..0cb53d1bfe5 100644
--- a/libglusterfs/src/common-utils.h
+++ b/libglusterfs/src/common-utils.h
@@ -98,7 +98,7 @@ extern char *gf_mgmt_list[GF_MGMT_MAXVALUE];
"invalid argument: " #arg); \
goto label; \
} \
- } while (0);
+ } while (0);
#define GF_VALIDATE_OR_GOTO(name,arg,label) do { \
if (!arg) { \
@@ -107,7 +107,7 @@ extern char *gf_mgmt_list[GF_MGMT_MAXVALUE];
"invalid argument: " #arg); \
goto label; \
} \
- } while (0);
+ } while (0);
#define GF_VALIDATE_OR_GOTO_WITH_ERROR(name, arg, label, errno, error) do { \
if (!arg) { \
@@ -132,13 +132,17 @@ extern char *gf_mgmt_list[GF_MGMT_MAXVALUE];
#define GF_FILE_CONTENT_REQUESTED(_xattr_req,_content_limit) \
(dict_get_uint64 (_xattr_req, "glusterfs.content", _content_limit) == 0)
-#define GF_ASSERT(x) \
+#ifdef DEBUG
+#define GF_ASSERT(x) assert (x);
+#else
+#define GF_ASSERT(x)\
do { \
if (!(x)) { \
gf_log_callingfn ("", GF_LOG_ERROR, \
"Assertion failed: " #x); \
} \
} while (0);
+#endif
static inline void
iov_free (struct iovec *vector, int count)