[Groonga-commit] groonga/groonga at a6a7d7d [master] Support dumping allocation information by status on memory debug mode

Back to archive index

Kouhei Sutou null+****@clear*****
Sat Mar 19 00:32:36 JST 2016


Kouhei Sutou	2016-03-19 00:32:36 +0900 (Sat, 19 Mar 2016)

  New Revision: a6a7d7da947a7ad6e79f0db870f42c2f9a4de9e3
  https://github.com/groonga/groonga/commit/a6a7d7da947a7ad6e79f0db870f42c2f9a4de9e3

  Message:
    Support dumping allocation information by status on memory debug mode

  Modified files:
    lib/ctx.c
    lib/grn_ctx.h
    lib/proc.c

  Modified: lib/ctx.c (+6 -0)
===================================================================
--- lib/ctx.c    2016-03-19 00:12:03 +0900 (00484ee)
+++ lib/ctx.c    2016-03-19 00:32:36 +0900 (d2413c1)
@@ -481,6 +481,12 @@ grn_alloc_info_free(grn_ctx *ctx)
 #  define grn_alloc_info_free(ctx)
 #endif /* USE_MEMORY_DEBUG */
 
+void
+grn_debug_dump_alloc_info(grn_ctx *ctx)
+{
+  grn_alloc_info_dump(ctx);
+}
+
 #ifdef USE_FAIL_MALLOC
 int grn_fmalloc_prob = 0;
 char *grn_fmalloc_func = NULL;

  Modified: lib/grn_ctx.h (+2 -0)
===================================================================
--- lib/grn_ctx.h    2016-03-19 00:12:03 +0900 (854b923)
+++ lib/grn_ctx.h    2016-03-19 00:32:36 +0900 (c5046bf)
@@ -537,6 +537,8 @@ GRN_API void grn_ctx_set_next_expr(grn_ctx *ctx, grn_obj *expr);
 
 int grn_alloc_count(void);
 
+void grn_debug_dump_alloc_info(grn_ctx *ctx);
+
 grn_content_type grn_get_ctype(grn_obj *var);
 
 /**** db_obj ****/

  Modified: lib/proc.c (+6 -0)
===================================================================
--- lib/proc.c    2016-03-19 00:12:03 +0900 (86eae1a)
+++ lib/proc.c    2016-03-19 00:32:36 +0900 (8be6dc5)
@@ -17,6 +17,7 @@
 */
 
 #include "grn_proc.h"
+#include "grn_ctx.h"
 #include "grn_ii.h"
 #include "grn_db.h"
 #include "grn_util.h"
@@ -197,6 +198,11 @@ proc_status(grn_ctx *ctx, int nargs, grn_obj **args, grn_user_data *user_data)
   GRN_OUTPUT_CSTR("max_command_version");
   GRN_OUTPUT_INT32(GRN_COMMAND_VERSION_MAX);
   GRN_OUTPUT_MAP_CLOSE();
+
+#ifdef USE_MEMORY_DEBUG
+  grn_debug_dump_alloc_info(&grn_gctx);
+#endif /* USE_MEMORY_DEBUG */
+
   return NULL;
 }
 
-------------- next part --------------
HTML����������������������������...
Download 



More information about the Groonga-commit mailing list
Back to archive index