[Groonga-mysql-commit] mroonga/mroonga [fix-for-visual-studio] Use static grn_ctx allocation instead of dynamic allocation

Back to archive index

Kouhei Sutou null+****@clear*****
Thu Oct 4 10:42:38 JST 2012


Kouhei Sutou	2012-04-20 21:59:42 +0900 (Fri, 20 Apr 2012)

  New Revision: bf2371fd5200405f6f4a42e5699a3be6e0c07b3a
  https://github.com/mroonga/mroonga/commit/bf2371fd5200405f6f4a42e5699a3be6e0c07b3a

  Merged d2a70dc: Merge branch 'master' of github.com:mroonga/mroonga

  Log:
    Use static grn_ctx allocation instead of dynamic allocation

  Modified files:
    ha_mroonga.cpp
    ha_mroonga.hpp

  Modified: ha_mroonga.cpp (+3 -1)
===================================================================
--- ha_mroonga.cpp    2012-04-20 16:27:07 +0900 (2771470)
+++ ha_mroonga.cpp    2012-04-20 21:59:42 +0900 (05c587e)
@@ -1681,6 +1681,8 @@ ha_mroonga::ha_mroonga(handlerton *hton, TABLE_SHARE *share_arg)
 #endif
    mrn_lock_type(F_UNLCK),
 
+   ctx_entity_(),
+   ctx(&ctx_entity_),
    grn_table(NULL),
    grn_columns(NULL),
    grn_index_tables(NULL),
@@ -1715,7 +1717,7 @@ ha_mroonga::ha_mroonga(handlerton *hton, TABLE_SHARE *share_arg)
    replacing_(false)
 {
   MRN_DBUG_ENTER_METHOD();
-  ctx = grn_ctx_open(0);
+  grn_ctx_init(ctx, 0);
   mrn_change_encoding(ctx, system_charset_info);
   grn_ctx_use(ctx, mrn_db);
   GRN_WGS84_GEO_POINT_INIT(&top_left_point, 0);

  Modified: ha_mroonga.hpp (+1 -0)
===================================================================
--- ha_mroonga.hpp    2012-04-20 16:27:07 +0900 (6243f9b)
+++ ha_mroonga.hpp    2012-04-20 21:59:42 +0900 (4ded7de)
@@ -188,6 +188,7 @@ private:
   int mrn_lock_type;
 
   // for groonga objects
+  grn_ctx ctx_entity_;
   grn_ctx *ctx;
   grn_obj *grn_table;
   grn_obj **grn_columns;
-------------- next part --------------
HTML����������������������������...
Download 



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