31
31
32
32
/* An element of the list */
33
33
typedef struct {
34
- intptr volatile link ; /* a pointer to the next element in a list and a flag */
35
- uint32 hashnr ; /* reversed hash number, for sorting */
34
+ intptr link ; /* a pointer to the next element in a list and a flag */
36
35
const uchar * key ;
37
36
size_t keylen ;
37
+ uint32 hashnr ; /* reversed hash number, for sorting */
38
38
/*
39
39
data is stored here, directly after the keylen.
40
40
thus the pointer to data is (void*)(slist_element_ptr+1)
@@ -48,7 +48,7 @@ const int LF_HASH_OVERHEAD= sizeof(LF_SLIST);
48
48
in a list) from l_find to l_insert/l_delete
49
49
*/
50
50
typedef struct {
51
- intptr volatile * prev ;
51
+ intptr * prev ;
52
52
LF_SLIST * curr , * next ;
53
53
} CURSOR ;
54
54
@@ -85,7 +85,7 @@ typedef struct {
85
85
0 - ok
86
86
1 - error (callbck returned 1)
87
87
*/
88
- static int l_find (LF_SLIST * volatile * head , CHARSET_INFO * cs , uint32 hashnr ,
88
+ static int l_find (LF_SLIST * * head , CHARSET_INFO * cs , uint32 hashnr ,
89
89
const uchar * key , uint keylen , CURSOR * cursor , LF_PINS * pins ,
90
90
my_hash_walk_action callback )
91
91
{
@@ -168,7 +168,7 @@ static int l_find(LF_SLIST * volatile *head, CHARSET_INFO *cs, uint32 hashnr,
168
168
it uses pins[0..2], on return all pins are removed.
169
169
if there're nodes with the same key value, a new node is added before them.
170
170
*/
171
- static LF_SLIST * l_insert (LF_SLIST * volatile * head , CHARSET_INFO * cs ,
171
+ static LF_SLIST * l_insert (LF_SLIST * * head , CHARSET_INFO * cs ,
172
172
LF_SLIST * node , LF_PINS * pins , uint flags )
173
173
{
174
174
CURSOR cursor ;
@@ -220,7 +220,7 @@ static LF_SLIST *l_insert(LF_SLIST * volatile *head, CHARSET_INFO *cs,
220
220
NOTE
221
221
it uses pins[0..2], on return all pins are removed.
222
222
*/
223
- static int l_delete (LF_SLIST * volatile * head , CHARSET_INFO * cs , uint32 hashnr ,
223
+ static int l_delete (LF_SLIST * * head , CHARSET_INFO * cs , uint32 hashnr ,
224
224
const uchar * key , uint keylen , LF_PINS * pins )
225
225
{
226
226
CURSOR cursor ;
@@ -278,7 +278,7 @@ static int l_delete(LF_SLIST * volatile *head, CHARSET_INFO *cs, uint32 hashnr,
278
278
it uses pins[0..2], on return the pin[2] keeps the node found
279
279
all other pins are removed.
280
280
*/
281
- static LF_SLIST * l_search (LF_SLIST * volatile * head , CHARSET_INFO * cs ,
281
+ static LF_SLIST * l_search (LF_SLIST * * head , CHARSET_INFO * cs ,
282
282
uint32 hashnr , const uchar * key , uint keylen ,
283
283
LF_PINS * pins )
284
284
{
@@ -319,7 +319,7 @@ static inline my_hash_value_type calc_hash(CHARSET_INFO *cs,
319
319
320
320
#define MAX_LOAD 1.0 /* average number of elements in a bucket */
321
321
322
- static int initialize_bucket (LF_HASH * , LF_SLIST * volatile * , uint , LF_PINS * );
322
+ static int initialize_bucket (LF_HASH * , LF_SLIST * * , uint , LF_PINS * );
323
323
324
324
static void default_initializer (LF_HASH * hash , void * dst , const void * src )
325
325
{
@@ -398,7 +398,7 @@ void lf_hash_destroy(LF_HASH *hash)
398
398
int lf_hash_insert (LF_HASH * hash , LF_PINS * pins , const void * data )
399
399
{
400
400
int csize , bucket , hashnr ;
401
- LF_SLIST * node , * volatile * el ;
401
+ LF_SLIST * node , * * el ;
402
402
403
403
node = (LF_SLIST * )lf_alloc_new (pins );
404
404
if (unlikely (!node ))
@@ -437,7 +437,7 @@ int lf_hash_insert(LF_HASH *hash, LF_PINS *pins, const void *data)
437
437
*/
438
438
int lf_hash_delete (LF_HASH * hash , LF_PINS * pins , const void * key , uint keylen )
439
439
{
440
- LF_SLIST * volatile * el ;
440
+ LF_SLIST * * el ;
441
441
uint bucket , hashnr ;
442
442
443
443
hashnr = hash -> hash_function (hash -> charset , (uchar * )key , keylen ) & INT_MAX32 ;
@@ -473,7 +473,7 @@ void *lf_hash_search_using_hash_value(LF_HASH *hash, LF_PINS *pins,
473
473
my_hash_value_type hashnr ,
474
474
const void * key , uint keylen )
475
475
{
476
- LF_SLIST * volatile * el , * found ;
476
+ LF_SLIST * * el , * found ;
477
477
uint bucket ;
478
478
479
479
/* hide OOM errors - if we cannot initialize a bucket, try the previous one */
@@ -507,7 +507,7 @@ int lf_hash_iterate(LF_HASH *hash, LF_PINS *pins,
507
507
CURSOR cursor ;
508
508
uint bucket = 0 ;
509
509
int res ;
510
- LF_SLIST * volatile * el ;
510
+ LF_SLIST * * el ;
511
511
512
512
el = lf_dynarray_lvalue (& hash -> array , bucket );
513
513
if (unlikely (!el ))
@@ -539,13 +539,13 @@ static const uchar *dummy_key= (uchar*)"";
539
539
0 - ok
540
540
-1 - out of memory
541
541
*/
542
- static int initialize_bucket (LF_HASH * hash , LF_SLIST * volatile * node ,
542
+ static int initialize_bucket (LF_HASH * hash , LF_SLIST * * node ,
543
543
uint bucket , LF_PINS * pins )
544
544
{
545
545
uint parent = my_clear_highest_bit (bucket );
546
546
LF_SLIST * dummy = (LF_SLIST * )my_malloc (sizeof (LF_SLIST ), MYF (MY_WME ));
547
547
LF_SLIST * * tmp = 0 , * cur ;
548
- LF_SLIST * volatile * el = lf_dynarray_lvalue (& hash -> array , parent );
548
+ LF_SLIST * * el = lf_dynarray_lvalue (& hash -> array , parent );
549
549
if (unlikely (!el || !dummy ))
550
550
return -1 ;
551
551
if (* el == NULL && bucket &&
0 commit comments