[Groonga-commit] groonga/groonga at 80d60c3 [master] Stop to use custom malloc/free for mruby on memory debug mode

Back to archive index

Kouhei Sutou null+****@clear*****
Sat Mar 19 00:06:54 JST 2016


Kouhei Sutou	2016-03-19 00:06:54 +0900 (Sat, 19 Mar 2016)

  New Revision: 80d60c35daf2b9ecf5ca01eca770ecd068aef6f1
  https://github.com/groonga/groonga/commit/80d60c35daf2b9ecf5ca01eca770ecd068aef6f1

  Message:
    Stop to use custom malloc/free for mruby on memory debug mode

  Modified files:
    lib/ctx_impl_mrb.c

  Modified: lib/ctx_impl_mrb.c (+6 -0)
===================================================================
--- lib/ctx_impl_mrb.c    2016-03-19 00:04:53 +0900 (e63f0e1)
+++ lib/ctx_impl_mrb.c    2016-03-19 00:06:54 +0900 (dc7a925)
@@ -197,6 +197,7 @@ grn_ctx_impl_mrb_init_bindings(grn_ctx *ctx)
   mrb_funcall(mrb, mrb_obj_value(ctx->impl->mrb.module), "init", 0);
 }
 
+#ifndef USE_MEMORY_DEBUG
 static void *
 grn_ctx_impl_mrb_allocf(mrb_state *mrb, void *ptr, size_t size, void *ud)
 {
@@ -215,6 +216,7 @@ grn_ctx_impl_mrb_allocf(mrb_state *mrb, void *ptr, size_t size, void *ud)
     }
   }
 }
+#endif /* USE_MEMORY_DEBUG */
 
 void
 grn_ctx_impl_mrb_init(grn_ctx *ctx)
@@ -230,7 +232,11 @@ grn_ctx_impl_mrb_init(grn_ctx *ctx)
     ctx->impl->mrb.groonga.operator_class = NULL;
   } else {
     mrb_state *mrb;
+#ifdef USE_MEMORY_DEBUG
+    mrb = mrb_open();
+#else /* USE_MEMORY_DEBUG */
     mrb = mrb_open_allocf(grn_ctx_impl_mrb_allocf, ctx);
+#endif /* USE_MEMORY_DEBUG */
     ctx->impl->mrb.state = mrb;
     ctx->impl->mrb.base_directory[0] = '\0';
     grn_ctx_impl_mrb_init_bindings(ctx);
-------------- next part --------------
HTML����������������������������...
Descargar 



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