diff options
Diffstat (limited to 'libglusterfs')
-rw-r--r-- | libglusterfs/src/common-utils.h | 10 | ||||
-rw-r--r-- | libglusterfs/src/mem-pool.c | 5 |
2 files changed, 12 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) diff --git a/libglusterfs/src/mem-pool.c b/libglusterfs/src/mem-pool.c index 76b62902317..a8eb985b8a8 100644 --- a/libglusterfs/src/mem-pool.c +++ b/libglusterfs/src/mem-pool.c @@ -51,6 +51,11 @@ gf_mem_acct_enable_set () char *opt = NULL; long val = -1; +#ifdef DEBUG + gf_mem_acct_enable = 1; + return; +#endif + opt = getenv (GLUSTERFS_ENV_MEM_ACCT_STR); if (!opt) |