diff options
author | Jiffin Tony Thottan <jthottan@redhat.com> | 2015-03-09 12:07:57 +0530 |
---|---|---|
committer | Vijay Bellur <vbellur@redhat.com> | 2015-03-09 10:42:46 -0700 |
commit | 83eab209d82c92a2676d1f794d5d24af0ac5bbab (patch) | |
tree | 5a8cc9a083dbe8b497ad915db7c676ee2073b440 /libglusterfs | |
parent | 3361bab0388f7cdad50e1c67e1127801fda05685 (diff) |
core : using gluster-like memory allocation for parse-utility feature
Change-Id: I58dc7e0dc8d4ac4e10795e0536fcd0e1722116ed
BUG: 1143880
Signed-off-by: Jiffin Tony Thottan <jthottan@redhat.com>
Reviewed-on: http://review.gluster.org/9830
Reviewed-by: Niels de Vos <ndevos@redhat.com>
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Diffstat (limited to 'libglusterfs')
-rw-r--r-- | libglusterfs/src/mem-types.h | 1 | ||||
-rw-r--r-- | libglusterfs/src/parse-utils.c | 8 |
2 files changed, 5 insertions, 4 deletions
diff --git a/libglusterfs/src/mem-types.h b/libglusterfs/src/mem-types.h index 0db06f52c98..93aea8502e3 100644 --- a/libglusterfs/src/mem-types.h +++ b/libglusterfs/src/mem-types.h @@ -128,6 +128,7 @@ enum gf_common_mem_types_ { gf_common_mt_ereg = 112, gf_common_mt_wr = 113, gf_common_mt_rdma_arena_mr = 114, + gf_common_mt_parser_t = 115, gf_common_mt_end }; #endif diff --git a/libglusterfs/src/parse-utils.c b/libglusterfs/src/parse-utils.c index 3934586aa32..f7e9988ab64 100644 --- a/libglusterfs/src/parse-utils.c +++ b/libglusterfs/src/parse-utils.c @@ -40,7 +40,7 @@ parser_init (const char *regex) int rc = 0; struct parser *parser = NULL; - parser = MALLOC (sizeof(*parser)); + parser = GF_MALLOC (sizeof(*parser), gf_common_mt_parser_t); if (!parser) goto out; @@ -48,7 +48,7 @@ parser_init (const char *regex) if (!parser->regex) { gf_log (GF_PARSE, GF_LOG_INFO, "Failed to duplicate regex string!"); - FREE (parser); + GF_FREE (parser); parser = NULL; goto out; } @@ -135,9 +135,9 @@ parser_deinit (struct parser *ptr) return; regfree (&ptr->preg); - FREE (ptr->complete_str); + GF_FREE (ptr->complete_str); GF_FREE (ptr->regex); - FREE (ptr); + GF_FREE (ptr); } /** |