summaryrefslogtreecommitdiff
path: root/include/lf.h
diff options
context:
space:
mode:
authorSergey Vojtovich <svoj@mariadb.org>2015-03-16 18:44:06 +0400
committerSergey Vojtovich <svoj@mariadb.org>2015-03-16 19:07:51 +0400
commit6bd24deab46efc7d67401ac1b30194f03a03ad02 (patch)
treeb6d6667d8b12429b0ffc96a850a88df1c8a2304b /include/lf.h
parent18e9c314e43271debf58f3c3e5bf454eab655799 (diff)
downloadmariadb-git-6bd24deab46efc7d67401ac1b30194f03a03ad02.tar.gz
MDEV-7728 - Improve xid cache scalability by using lock-free hash
XID cache is now based on lock-free hash. Also fixed lf_hash_destroy() to call alloc destructor. Note that previous implementation had race condition when thread was accessing XA owned by different thread. This new implementation doesn't fix it either.
Diffstat (limited to 'include/lf.h')
-rw-r--r--include/lf.h7
1 files changed, 6 insertions, 1 deletions
diff --git a/include/lf.h b/include/lf.h
index 88024bc4d67..19bdafce647 100644
--- a/include/lf.h
+++ b/include/lf.h
@@ -117,7 +117,12 @@ uint lf_alloc_pool_count(LF_ALLOCATOR *allocator);
#define lf_alloc_free(PINS, PTR) lf_pinbox_free((PINS), (PTR))
#define lf_alloc_get_pins(A) lf_pinbox_get_pins(&(A)->pinbox)
#define lf_alloc_put_pins(PINS) lf_pinbox_put_pins(PINS)
-#define lf_alloc_direct_free(ALLOC, ADDR) my_free((ADDR))
+#define lf_alloc_direct_free(ALLOC, ADDR) \
+ do { \
+ if ((ALLOC)->destructor) \
+ (ALLOC)->destructor((uchar*) ADDR); \
+ my_free(ADDR); \
+ } while(0)
void *lf_alloc_new(LF_PINS *pins);