Merge branch 'master' of github.com:apple/foundationdb into features/no-make
This commit is contained in:
commit
213ff28df6
|
@ -3290,7 +3290,7 @@ private:
|
|||
public:
|
||||
|
||||
|
||||
//#include "ArtMutationBuffer.h"
|
||||
#include "ArtMutationBuffer.h"
|
||||
struct MutationBufferStdMap {
|
||||
MutationBufferStdMap() {
|
||||
// Create range representing the entire keyspace. This reduces edge cases to applying mutations
|
||||
|
@ -3388,7 +3388,7 @@ public:
|
|||
}
|
||||
|
||||
};
|
||||
//#define USE_ART_MUTATION_BUFFER 1
|
||||
#define USE_ART_MUTATION_BUFFER 1
|
||||
|
||||
#ifdef USE_ART_MUTATION_BUFFER
|
||||
typedef struct MutationBufferART MutationBuffer;
|
||||
|
@ -5006,7 +5006,7 @@ private:
|
|||
|
||||
};
|
||||
|
||||
//#include "art_impl.h"
|
||||
#include "art_impl.h"
|
||||
|
||||
RedwoodRecordRef VersionedBTree::dbBegin(StringRef(), 0);
|
||||
RedwoodRecordRef VersionedBTree::dbEnd(LiteralStringRef("\xff\xff\xff\xff\xff"));
|
||||
|
|
|
@ -21,24 +21,10 @@
|
|||
|
||||
#include <stdint.h>
|
||||
#include "flow/Arena.h"
|
||||
#include "flow/Platform.h"
|
||||
|
||||
#ifndef ART_H
|
||||
#define ART_H
|
||||
//#define DEBUG
|
||||
|
||||
#ifdef DEBUG
|
||||
#define ARTRACE(format, arg...)\
|
||||
do { \
|
||||
fprintf(stdout, "%s:%d:" format , __FUNCTION__, __LINE__,##arg); fflush(stdout);\
|
||||
} while (0)
|
||||
|
||||
#define ART_PRINT(format, arg...) fprintf(stdout, "" format , ##arg); fflush(stdout);
|
||||
|
||||
#else //NO DEBUG
|
||||
|
||||
|
||||
#define ART_PRINT(format, arg...)
|
||||
#endif //DEBUG
|
||||
|
||||
|
||||
struct art_iterator;
|
||||
|
|
|
@ -451,7 +451,7 @@ art_node **art_tree::find_child(art_node *n, unsigned char c) {
|
|||
* the index.
|
||||
*/
|
||||
if (bitfield)
|
||||
return &p.p2->children[__builtin_ctz(bitfield)];
|
||||
return &p.p2->children[ctz(bitfield)];
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -559,7 +559,7 @@ void art_tree::find_next(art_node *n, unsigned char c, art_node **out) {
|
|||
//ALL children greater than char have their bit set
|
||||
//We need the smallest one
|
||||
//let's get the least significant bit that is set in the bitfield
|
||||
int one = __builtin_ctz(bitfield);
|
||||
int one = ctz(bitfield);
|
||||
*out = p.p2->children[one];
|
||||
}
|
||||
break;
|
||||
|
@ -1303,7 +1303,7 @@ void art_tree::add_child16(art_node16 *n, art_node **ref, unsigned char c, void
|
|||
// Check if less than any
|
||||
unsigned idx;
|
||||
if (bitfield) {
|
||||
idx = __builtin_ctz(bitfield);
|
||||
idx = ctz(bitfield);
|
||||
memmove(n->keys + idx + 1, n->keys + idx, n->n.num_children - idx);
|
||||
memmove(n->children + idx + 1, n->children + idx,
|
||||
(n->n.num_children - idx) * sizeof(void *));
|
||||
|
@ -1472,7 +1472,7 @@ void art_tree::find_prev(art_node *n, unsigned char c, art_node **out) {
|
|||
bitfield = _mm_movemask_epi8(cmp) & mask;
|
||||
if (bitfield) {
|
||||
//We have at least one bit set to one, so the largest smaller exists
|
||||
int one = __builtin_clz(bitfield);
|
||||
int one = clz(bitfield);
|
||||
one = (sizeof(bitfield) * 8) - one;
|
||||
*out = p.p2->children[one - 1];
|
||||
} else {
|
||||
|
|
Loading…
Reference in New Issue