summaryrefslogtreecommitdiff
path: root/include/hash.h
diff options
context:
space:
mode:
authorunknown <dlenev@mockturtle.local>2006-11-01 15:41:48 +0300
committerunknown <dlenev@mockturtle.local>2006-11-01 15:41:48 +0300
commit57c2f22a54f33267e2f9cc7437f78f36b47a32fe (patch)
tree32608cc8af7279830719cc05da6c2b37553df5a2 /include/hash.h
parentb372ebc5ef988bd08dfa86f491cd325bc83e4b7c (diff)
downloadmariadb-git-57c2f22a54f33267e2f9cc7437f78f36b47a32fe.tar.gz
Small cleanup in code handling stored routines/table prelocking.
Use lazy initialization for Query_tables_list::sroutines hash. This step should significantly decrease amount of memory consumed by stored routines as we no longer will allocate chunk of memory required for this HASH for each statement in routine. include/hash.h: Introduced auxillary hash_init_opt() macro which simplifies lazy initialization of HASH objects. sql/sp.cc: Use lazy initialization for Query_tables_list::sroutines hash. This step should significantly decrease amount of memory consumed by stored routines as we no longer will allocate chunk of memory required for this HASH for each statement in routine. sql/sql_lex.cc: Use lazy initialization for Query_tables_list::sroutines hash. This step should significantly decrease amount of memory consumed by stored routines as we no longer will allocate chunk of memory required for this HASH for each statement in routine. sql/sql_lex.h: Updated comment describing Query_tables_list::sroutines to reflect that now we are use lazy initialization for this hash. Added constant for initial size of this hash.
Diffstat (limited to 'include/hash.h')
-rw-r--r--include/hash.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/include/hash.h b/include/hash.h
index 8f5ff21ae5e..4d6ee77fa0c 100644
--- a/include/hash.h
+++ b/include/hash.h
@@ -65,6 +65,8 @@ my_bool hash_check(HASH *hash); /* Only in debug library */
#define hash_clear(H) bzero((char*) (H),sizeof(*(H)))
#define hash_inited(H) ((H)->array.buffer != 0)
+#define hash_init_opt(A,B,C,D,E,F,G,H) \
+ (!hash_inited(A) && _hash_init(A,B,C,D,E,F,G, H CALLER_INFO))
#ifdef __cplusplus
}