summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergei Golubchik <sergii@pisem.net>2012-09-04 12:12:28 +0200
committerSergei Golubchik <sergii@pisem.net>2012-09-04 12:12:28 +0200
commit0b5564b86c29d00ed3b28c9112d09214ea266d23 (patch)
tree706c509977c5d6587f8089a6f2341abbb0499fb0
parent5620937c058aa9f7cd3b122b40f8b9c94fa69997 (diff)
downloadmariadb-git-0b5564b86c29d00ed3b28c9112d09214ea266d23.tar.gz
1. fix an old typo. A purgatory must be cleaned on every LF_PURGATORY_SIZE freeing,
not every time. 2. Increase purgatory size. include/lf.h: allocate larger purgatory mysys/lf_alloc-pin.c: typo.
-rw-r--r--include/lf.h2
-rw-r--r--mysys/lf_alloc-pin.c2
2 files changed, 2 insertions, 2 deletions
diff --git a/include/lf.h b/include/lf.h
index cdd24c07502..07769d10943 100644
--- a/include/lf.h
+++ b/include/lf.h
@@ -95,7 +95,7 @@ nolock_wrap(lf_dynarray_iterate, int,
*/
#define LF_PINBOX_PINS 4
-#define LF_PURGATORY_SIZE 10
+#define LF_PURGATORY_SIZE 100
typedef void lf_pinbox_free_func(void *, void *, void*);
diff --git a/mysys/lf_alloc-pin.c b/mysys/lf_alloc-pin.c
index d23ef129aa2..6ab6ba3aae0 100644
--- a/mysys/lf_alloc-pin.c
+++ b/mysys/lf_alloc-pin.c
@@ -271,7 +271,7 @@ static int ptr_cmp(void **a, void **b)
void _lf_pinbox_free(LF_PINS *pins, void *addr)
{
add_to_purgatory(pins, addr);
- if (pins->purgatory_count % LF_PURGATORY_SIZE)
+ if (pins->purgatory_count % LF_PURGATORY_SIZE == 0)
_lf_pinbox_real_free(pins);
}