summaryrefslogtreecommitdiff
path: root/include/my_bitmap.h
diff options
context:
space:
mode:
authorSergei Golubchik <sergii@pisem.net>2011-07-02 22:08:51 +0200
committerSergei Golubchik <sergii@pisem.net>2011-07-02 22:08:51 +0200
commit9809f05199aeb0b67991fac41bd86f38730768dc (patch)
treefa2792ff86d0da014b535d743759810612338042 /include/my_bitmap.h
parent0accbd0364e0333e0b119aa9ce93e34ded9df6cb (diff)
parent5a0e7394a5ae0c7b6a1ea35b7ea3a8985325987a (diff)
downloadmariadb-git-9809f05199aeb0b67991fac41bd86f38730768dc.tar.gz
5.5-merge
Diffstat (limited to 'include/my_bitmap.h')
-rw-r--r--include/my_bitmap.h13
1 files changed, 5 insertions, 8 deletions
diff --git a/include/my_bitmap.h b/include/my_bitmap.h
index c92f28630e2..2b173e7627c 100644
--- a/include/my_bitmap.h
+++ b/include/my_bitmap.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000 MySQL AB, 2009 Sun Microsystems, Inc
+/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -19,9 +19,7 @@
#define MY_BIT_NONE (~(uint) 0)
#include <m_string.h>
-#ifdef THREAD
#include <my_pthread.h>
-#endif
typedef uint32 my_bitmap_map;
@@ -34,9 +32,7 @@ typedef struct st_bitmap
thread_safe flag in bitmap_init was set. Otherwise, we optimize by not
acquiring the mutex
*/
-#ifdef THREAD
mysql_mutex_t *mutex;
-#endif
my_bitmap_map last_word_mask;
uint32 n_bits; /* number of bits occupied by the above */
} MY_BITMAP;
@@ -132,9 +128,10 @@ bitmap_is_set(const MY_BITMAP *map,uint bit)
static inline my_bool bitmap_cmp(const MY_BITMAP *map1, const MY_BITMAP *map2)
{
- *(map1)->last_word_ptr|= (map1)->last_word_mask;
- *(map2)->last_word_ptr|= (map2)->last_word_mask;
- return memcmp((map1)->bitmap, (map2)->bitmap, 4*no_words_in_map((map1)))==0;
+ if (memcmp(map1->bitmap, map2->bitmap, 4*(no_words_in_map(map1)-1)) != 0)
+ return FALSE;
+ return ((*map1->last_word_ptr | map1->last_word_mask) ==
+ (*map2->last_word_ptr | map2->last_word_mask));
}
#define bitmap_clear_all(MAP) \