Commit 0b5564b8 authored by Sergei Golubchik's avatar Sergei Golubchik

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.
parent 5620937c
...@@ -95,7 +95,7 @@ nolock_wrap(lf_dynarray_iterate, int, ...@@ -95,7 +95,7 @@ nolock_wrap(lf_dynarray_iterate, int,
*/ */
#define LF_PINBOX_PINS 4 #define LF_PINBOX_PINS 4
#define LF_PURGATORY_SIZE 10 #define LF_PURGATORY_SIZE 100
typedef void lf_pinbox_free_func(void *, void *, void*); typedef void lf_pinbox_free_func(void *, void *, void*);
......
...@@ -271,7 +271,7 @@ static int ptr_cmp(void **a, void **b) ...@@ -271,7 +271,7 @@ static int ptr_cmp(void **a, void **b)
void _lf_pinbox_free(LF_PINS *pins, void *addr) void _lf_pinbox_free(LF_PINS *pins, void *addr)
{ {
add_to_purgatory(pins, 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); _lf_pinbox_real_free(pins);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment