Bonjour Marc,
Marc Alff a écrit, Le 13.05.2011 18:04:
> #At file:///Users/malff/BZR_TREE/mysql-5.5-bug12552516/ based on
> revid:bjorn.munch@stripped
>
> 3383 Marc Alff 2011-05-13
> Bug#12552516 LF_HASH REQUIRES MY_THREAD_INIT()
> @@ -327,34 +333,37 @@ static int match_pins(LF_PINS *el, void
> */
> static void _lf_pinbox_real_free(LF_PINS *pins)
> {
> - int npins, alloca_size;
> - void *list, **addr;
> + int npins;
> + void *list;
> + void **addr= NULL;
> void *first= NULL, *last= NULL;
> LF_PINBOX *pinbox= pins->pinbox;
>
> npins= pinbox->pins_in_array+1;
>
> #ifdef HAVE_ALLOCA
> - 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) >
> alloca_size)
> + if (pins->stack_ends_here != NULL)
> {
> - struct st_harvester hv;
> - addr= (void **) alloca(alloca_size);
> - hv.granary= addr;
> - hv.npins= npins;
> - /* scan the dynarray and accumulate all pinned addresses */
> - _lf_dynarray_iterate(&pinbox->pinarray,
> - (lf_dynarray_func)harvest_pins, &hv);
> -
> - npins= hv.granary-addr;
> - /* and sort them */
> - if (npins)
> - qsort(addr, npins, sizeof(void *), (qsort_cmp)ptr_cmp);
> + int alloca_size;
> + alloca_size= sizeof(void *)*LF_PINBOX_PINS*npins;
while you're changing this, you can write it on one line:
int alloca_size= sizeof(void *) * LF_PINBOX_PINS * npins;
ok to push.
--
Mr. Guilhem Bichot <guilhem.bichot@stripped>
Oracle / MySQL / Optimizer team, Lead Software Engineer
Bordeaux, France
www.oracle.com / www.mysql.com