summaryrefslogtreecommitdiff
path: root/mysys
diff options
context:
space:
mode:
authorAleksey Midenkov <midenok@gmail.com>2019-12-02 12:51:53 +0300
committerAleksey Midenkov <midenok@gmail.com>2019-12-02 12:51:53 +0300
commit0b8b11b0b15f2d3d20dc801e50fa2beedc080dad (patch)
tree7a7b9f8ec419bff57b3b0258293d91f180908037 /mysys
parent1d46923a0f6508d52d7ce679a7dd8e7e0e957ae4 (diff)
parentdb32d9457edbcb23b45f433cfcdfc5d86232bbb0 (diff)
downloadmariadb-git-0b8b11b0b15f2d3d20dc801e50fa2beedc080dad.tar.gz
Merge 10.3 into 10.4
Diffstat (limited to 'mysys')
-rw-r--r--mysys/lf_alloc-pin.c14
1 files changed, 5 insertions, 9 deletions
diff --git a/mysys/lf_alloc-pin.c b/mysys/lf_alloc-pin.c
index 2a0ee7fddf9..b98684556c3 100644
--- a/mysys/lf_alloc-pin.c
+++ b/mysys/lf_alloc-pin.c
@@ -151,7 +151,6 @@ void lf_pinbox_destroy(LF_PINBOX *pinbox)
*/
LF_PINS *lf_pinbox_get_pins(LF_PINBOX *pinbox)
{
- struct st_my_thread_var *var;
uint32 pins, next, top_ver;
LF_PINS *el;
/*
@@ -194,12 +193,7 @@ LF_PINS *lf_pinbox_get_pins(LF_PINBOX *pinbox)
el->link= pins;
el->purgatory_count= 0;
el->pinbox= pinbox;
- var= my_thread_var;
- /*
- Threads that do not call my_thread_init() should still be
- able to use the LF_HASH.
- */
- el->stack_ends_here= (var ? & var->stack_ends_here : NULL);
+
return el;
}
@@ -335,16 +329,18 @@ static void lf_pinbox_real_free(LF_PINS *pins)
void *list;
void **addr= NULL;
void *first= NULL, *last= NULL;
+ struct st_my_thread_var *var= my_thread_var;
+ void *stack_ends_here= var ? var->stack_ends_here : NULL;
LF_PINBOX *pinbox= pins->pinbox;
npins= pinbox->pins_in_array+1;
#ifdef HAVE_ALLOCA
- if (pins->stack_ends_here != NULL)
+ if (stack_ends_here != NULL)
{
int alloca_size= sizeof(void *)*LF_PINBOX_PINS*npins;
/* create a sorted list of pinned addresses, to speed up searches */
- if (available_stack_size(&pinbox, *pins->stack_ends_here) >
+ if (available_stack_size(&pinbox, stack_ends_here) >
alloca_size + ALLOCA_SAFETY_MARGIN)
{
struct st_harvester hv;