Below is the list of changes that have just been committed into a local
5.1 repository of jonas. When jonas does a push these changes will
be propagated to the main repository and, within 24 hours after the
push, to the public repository.
For information on how to access the public repository
see http://dev.mysql.com/doc/mysql/en/installing-source-tree.html
ChangeSet@stripped, 2008-01-23 10:11:40+01:00, jonas@stripped +3 -0
Merge perch.ndb.mysql.com:/home/jonas/src/50-telco-gca
into perch.ndb.mysql.com:/home/jonas/src/51-telco-gca
MERGE: 1.1810.2371.86
storage/ndb/include/util/Bitmask.hpp@stripped, 2008-01-23 10:08:36+01:00, jonas@stripped +0 -0
Auto merged
MERGE: 1.16.3.2
storage/ndb/include/util/Bitmask.hpp@stripped, 2008-01-23 10:08:36+01:00, jonas@stripped +0 -0
Merge rename: ndb/include/util/Bitmask.hpp -> storage/ndb/include/util/Bitmask.hpp
storage/ndb/src/common/util/Bitmask.cpp@stripped, 2008-01-23 10:11:38+01:00, jonas@stripped +0 -0
merge
MERGE: 1.8.2.2
storage/ndb/src/common/util/Bitmask.cpp@stripped, 2008-01-23 10:08:36+01:00, jonas@stripped +0 -0
Merge rename: ndb/src/common/util/Bitmask.cpp -> storage/ndb/src/common/util/Bitmask.cpp
storage/ndb/test/ndbapi/testBitfield.cpp@stripped, 2008-01-23 10:11:38+01:00, jonas@stripped +5 -4
merge
MERGE: 1.9.3.2
storage/ndb/test/ndbapi/testBitfield.cpp@stripped, 2008-01-23 10:08:36+01:00, jonas@stripped +0 -0
Merge rename: ndb/test/ndbapi/testBitfield.cpp -> storage/ndb/test/ndbapi/testBitfield.cpp
# This is a BitKeeper patch. What follows are the unified diffs for the
# set of deltas contained in the patch. The rest of the patch, the part
# that BitKeeper cares about, is below these diffs.
# User: jonas
# Host: perch.ndb.mysql.com
# Root: /home/jonas/src/51-telco-gca/RESYNC
--- 1.9.3.1/ndb/test/ndbapi/testBitfield.cpp 2008-01-23 10:11:43 +01:00
+++ 1.13/storage/ndb/test/ndbapi/testBitfield.cpp 2008-01-23 10:11:43 +01:00
@@ -10,6 +10,15 @@
static const char* _dbname = "TEST_DB";
static int g_loops = 7;
+
+NDB_STD_OPTS_VARS;
+
+static struct my_option my_long_options[] =
+{
+ NDB_STD_OPTS("ndb_desc"),
+ { 0, 0, 0, 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}
+};
+
static void usage()
{
ndb_std_print_version();
@@ -39,8 +48,9 @@
load_defaults("my",load_default_groups,&argc,&argv);
int ho_error;
- argc--;
- argv++;
+ if ((ho_error=handle_options(&argc, &argv, my_long_options,
+ ndb_std_get_one_option)))
+ return NDBT_ProgramExit(NDBT_WRONGARGS);
int res = NDBT_FAILED;
@@ -496,6 +506,7 @@
}
}
+#define NDB_BM_SUPPORT_RANGE
#ifdef NDB_BM_SUPPORT_RANGE
for(Uint32 i = 0; i<1000; i++)
{
--- 1.16.3.1/ndb/include/util/Bitmask.hpp 2008-01-23 10:11:43 +01:00
+++ 1.22/storage/ndb/include/util/Bitmask.hpp 2008-01-23 10:11:43 +01:00
@@ -47,6 +47,11 @@
static void set(unsigned size, Uint32 data[]);
/**
+ * set bit from <em>start</em> to <em>last</em>
+ */
+ static void set_range(unsigned size, Uint32 data[], unsigned start, unsigned last);
+
+ /**
* assign - Set all bits in <em>dst</em> to corresponding in <em>src/<em>
*/
static void assign(unsigned size, Uint32 dst[], const Uint32 src[]);
@@ -62,6 +67,14 @@
static void clear(unsigned size, Uint32 data[]);
/**
+ * clear bit from <em>start</em> to <em>last</em>
+ */
+ static void clear_range(unsigned size, Uint32 data[], unsigned start, unsigned last);
+
+ static Uint32 getWord(unsigned size, Uint32 data[], unsigned word_pos);
+ static void setWord(unsigned size, Uint32 data[],
+ unsigned word_pos, Uint32 new_word);
+ /**
* isclear - Check if all bits are clear. This is faster
* than checking count() == 0.
*/
@@ -182,6 +195,34 @@
}
}
+inline void
+BitmaskImpl::set_range(unsigned size, Uint32 data[],
+ unsigned start, unsigned last)
+{
+ Uint32 *ptr = data + (start >> 5);
+ Uint32 *end = data + (last >> 5);
+ assert(start <= last);
+ assert(last < (size << 5));
+
+ Uint32 tmp_word = ~(Uint32)0 << (start & 31);
+
+ if (ptr < end)
+ {
+ * ptr ++ |= tmp_word;
+
+ for(; ptr < end; )
+ {
+ * ptr ++ = ~(Uint32)0;
+ }
+
+ tmp_word = ~(Uint32)0;
+ }
+
+ tmp_word &= ~(~(Uint32)0 << (last & 31));
+
+ * ptr |= tmp_word;
+}
+
inline void
BitmaskImpl::assign(unsigned size, Uint32 dst[], const Uint32 src[])
{
@@ -205,6 +246,49 @@
}
}
+inline void
+BitmaskImpl::clear_range(unsigned size, Uint32 data[],
+ unsigned start, unsigned last)
+{
+ Uint32 *ptr = data + (start >> 5);
+ Uint32 *end = data + (last >> 5);
+ assert(start <= last);
+ assert(last < (size << 5));
+
+ Uint32 tmp_word = ~(Uint32)0 << (start & 31);
+
+ if (ptr < end)
+ {
+ * ptr ++ &= ~tmp_word;
+
+ for(; ptr < end; )
+ {
+ * ptr ++ = 0;
+ }
+
+ tmp_word = ~(Uint32)0;
+ }
+
+ tmp_word &= ~(~(Uint32)0 << (last & 31));
+
+ * ptr &= ~tmp_word;
+}
+
+inline
+Uint32
+BitmaskImpl::getWord(unsigned size, Uint32 data[], unsigned word_pos)
+{
+ return data[word_pos];
+}
+
+inline void
+BitmaskImpl::setWord(unsigned size, Uint32 data[],
+ unsigned word_pos, Uint32 new_word)
+{
+ data[word_pos] = new_word;
+ return;
+}
+
inline bool
BitmaskImpl::isclear(unsigned size, const Uint32 data[])
{
@@ -432,6 +516,12 @@
void clear();
/**
+ * Get and set words of bits
+ */
+ Uint32 getWord(unsigned word_pos);
+ void setWord(unsigned word_pos, Uint32 new_word);
+
+ /**
* isclear - Check if all bits are clear. This is faster
* than checking count() == 0.
*/
@@ -630,6 +720,20 @@
BitmaskPOD<size>::clear()
{
BitmaskPOD<size>::clear(rep.data);
+}
+
+template <unsigned size>
+inline Uint32
+BitmaskPOD<size>::getWord(unsigned word_pos)
+{
+ return BitmaskImpl::getWord(size, rep.data, word_pos);
+}
+
+template <unsigned size>
+inline void
+BitmaskPOD<size>::setWord(unsigned word_pos, Uint32 new_word)
+{
+ BitmaskImpl::setWord(size, rep.data, word_pos, new_word);
}
template <unsigned size>
| Thread |
|---|
| • bk commit into 5.1 tree (jonas:1.2530) | jonas | 23 Jan |