Navigation Menu

Skip to content

Commit

Permalink
Use static grn_ctx allocation instead of dynamic allocation
Browse files Browse the repository at this point in the history
  • Loading branch information
kou committed Apr 20, 2012
1 parent 3744017 commit bf2371f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
4 changes: 3 additions & 1 deletion ha_mroonga.cpp
Expand Up @@ -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),
Expand Down Expand Up @@ -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);
Expand Down
1 change: 1 addition & 0 deletions ha_mroonga.hpp
Expand Up @@ -188,6 +188,7 @@ class ha_mroonga: public handler
int mrn_lock_type;

// for groonga objects
grn_ctx ctx_entity_;
grn_ctx *ctx;
grn_obj *grn_table;
grn_obj **grn_columns;
Expand Down

0 comments on commit bf2371f

Please sign in to comment.