mirror of
https://github.com/isar/libmdbx.git
synced 2025-08-19 19:39:26 +08:00
mdbx: rename the rest MDBX_xyz.
This commit is contained in:
@@ -226,21 +226,21 @@ bool parse_option(int argc, char *const argv[], int &narg, const char *option,
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
const struct option_verb mode_bits[] = {
|
||||
{"rdonly", MDB_RDONLY}, {"mapasync", MDB_MAPASYNC},
|
||||
{"utterly", MDBX_UTTERLY_NOSYNC}, {"nosubdir", MDB_NOSUBDIR},
|
||||
{"nosync", MDB_NOSYNC}, {"nometasync", MDB_NOMETASYNC},
|
||||
{"writemap", MDB_WRITEMAP}, {"notls", MDB_NOTLS},
|
||||
{"nordahead", MDB_NORDAHEAD}, {"nomeminit", MDB_NOMEMINIT},
|
||||
{"rdonly", MDBX_RDONLY}, {"mapasync", MDBX_MAPASYNC},
|
||||
{"utterly", MDBX_UTTERLY_NOSYNC}, {"nosubdir", MDBX_NOSUBDIR},
|
||||
{"nosync", MDBX_NOSYNC}, {"nometasync", MDBX_NOMETASYNC},
|
||||
{"writemap", MDBX_WRITEMAP}, {"notls", MDBX_NOTLS},
|
||||
{"nordahead", MDBX_NORDAHEAD}, {"nomeminit", MDBX_NOMEMINIT},
|
||||
{"coasesce", MDBX_COALESCE}, {"lifo", MDBX_LIFORECLAIM},
|
||||
{"parturb", MDBX_PAGEPERTURB}, {nullptr, 0}};
|
||||
|
||||
const struct option_verb table_bits[] = {
|
||||
{"key.reverse", MDB_REVERSEKEY},
|
||||
{"key.integer", MDB_INTEGERKEY},
|
||||
{"data.integer", MDB_INTEGERDUP | MDB_DUPFIXED | MDB_DUPSORT},
|
||||
{"data.fixed", MDB_DUPFIXED | MDB_DUPSORT},
|
||||
{"data.reverse", MDB_REVERSEDUP | MDB_DUPSORT},
|
||||
{"data.dups", MDB_DUPSORT},
|
||||
{"key.reverse", MDBX_REVERSEKEY},
|
||||
{"key.integer", MDBX_INTEGERKEY},
|
||||
{"data.integer", MDBX_INTEGERDUP | MDBX_DUPFIXED | MDBX_DUPSORT},
|
||||
{"data.fixed", MDBX_DUPFIXED | MDBX_DUPSORT},
|
||||
{"data.reverse", MDBX_REVERSEDUP | MDBX_DUPSORT},
|
||||
{"data.dups", MDBX_DUPSORT},
|
||||
{nullptr, 0}};
|
||||
|
||||
static void dump_verbs(const char *caption, size_t bits,
|
||||
|
29
test/hill.cc
29
test/hill.cc
@@ -29,7 +29,7 @@ bool testcase_hill::run() {
|
||||
db_open();
|
||||
|
||||
txn_begin(false);
|
||||
MDB_dbi dbi = db_table_open(true);
|
||||
MDBX_dbi dbi = db_table_open(true);
|
||||
txn_end(false);
|
||||
|
||||
/* LY: тест "холмиком":
|
||||
@@ -46,7 +46,7 @@ bool testcase_hill::run() {
|
||||
* итерирование ключей интервалами различной ширины, с тем чтобы
|
||||
* проверить различные варианты как разделения, так и слияния страниц
|
||||
* внутри движка.
|
||||
* - при не-уникальных ключах (MDB_DUPSORT с подвариантами), для каждого
|
||||
* - при не-уникальных ключах (MDBX_DUPSORT с подвариантами), для каждого
|
||||
* повтора внутри движка формируется вложенное btree-дерево,
|
||||
* соответственно требуется соблюдение аналогичных принципов
|
||||
* итерирования для значений.
|
||||
@@ -61,10 +61,11 @@ bool testcase_hill::run() {
|
||||
keygen::buffer b_key = keygen::alloc(config.params.keylen_max);
|
||||
keygen::buffer b_data = keygen::alloc(config.params.datalen_max);
|
||||
|
||||
const unsigned insert_flags = (config.params.table_flags & MDB_DUPSORT)
|
||||
? MDB_NODUPDATA
|
||||
: MDB_NODUPDATA | MDB_NOOVERWRITE;
|
||||
const unsigned update_flags = MDB_CURRENT | MDB_NODUPDATA | MDB_NOOVERWRITE;
|
||||
const unsigned insert_flags = (config.params.table_flags & MDBX_DUPSORT)
|
||||
? MDBX_NODUPDATA
|
||||
: MDBX_NODUPDATA | MDBX_NOOVERWRITE;
|
||||
const unsigned update_flags =
|
||||
MDBX_CURRENT | MDBX_NODUPDATA | MDBX_NOOVERWRITE;
|
||||
|
||||
uint64_t serial_count = 0;
|
||||
unsigned txn_nops = 0;
|
||||
@@ -86,7 +87,7 @@ bool testcase_hill::run() {
|
||||
generate_pair(a_serial, a_key, a_data_1, age_shift);
|
||||
int rc = mdbx_put(txn_guard.get(), dbi, &a_key->value, &a_data_1->value,
|
||||
insert_flags);
|
||||
if (unlikely(rc != MDB_SUCCESS))
|
||||
if (unlikely(rc != MDBX_SUCCESS))
|
||||
failure_perror("mdbx_put(insert-a.1)", rc);
|
||||
|
||||
if (++txn_nops >= config.params.batch_write) {
|
||||
@@ -99,7 +100,7 @@ bool testcase_hill::run() {
|
||||
generate_pair(b_serial, b_key, b_data, 0);
|
||||
rc = mdbx_put(txn_guard.get(), dbi, &b_key->value, &b_data->value,
|
||||
insert_flags);
|
||||
if (unlikely(rc != MDB_SUCCESS))
|
||||
if (unlikely(rc != MDBX_SUCCESS))
|
||||
failure_perror("mdbx_put(insert-b)", rc);
|
||||
|
||||
if (++txn_nops >= config.params.batch_write) {
|
||||
@@ -113,7 +114,7 @@ bool testcase_hill::run() {
|
||||
generate_pair(a_serial, a_key, a_data_0, 0);
|
||||
rc = mdbx_replace(txn_guard.get(), dbi, &a_key->value, &a_data_0->value,
|
||||
&a_data_1->value, update_flags);
|
||||
if (unlikely(rc != MDB_SUCCESS))
|
||||
if (unlikely(rc != MDBX_SUCCESS))
|
||||
failure_perror("mdbx_put(update-a: 1->0)", rc);
|
||||
|
||||
if (++txn_nops >= config.params.batch_write) {
|
||||
@@ -124,7 +125,7 @@ bool testcase_hill::run() {
|
||||
// удаляем вторую запись
|
||||
log_trace("uphill: delete-b %" PRIu64, b_serial);
|
||||
rc = mdbx_del(txn_guard.get(), dbi, &b_key->value, &b_data->value);
|
||||
if (unlikely(rc != MDB_SUCCESS))
|
||||
if (unlikely(rc != MDBX_SUCCESS))
|
||||
failure_perror("mdbx_del(b)", rc);
|
||||
|
||||
if (++txn_nops >= config.params.batch_write) {
|
||||
@@ -159,7 +160,7 @@ bool testcase_hill::run() {
|
||||
log_trace("!!!");
|
||||
int rc = mdbx_replace(txn_guard.get(), dbi, &a_key->value, &a_data_1->value,
|
||||
&a_data_0->value, update_flags);
|
||||
if (unlikely(rc != MDB_SUCCESS))
|
||||
if (unlikely(rc != MDBX_SUCCESS))
|
||||
failure_perror("mdbx_put(update-a: 0->1)", rc);
|
||||
|
||||
if (++txn_nops >= config.params.batch_write) {
|
||||
@@ -172,7 +173,7 @@ bool testcase_hill::run() {
|
||||
generate_pair(b_serial, b_key, b_data, 0);
|
||||
rc = mdbx_put(txn_guard.get(), dbi, &b_key->value, &b_data->value,
|
||||
insert_flags);
|
||||
if (unlikely(rc != MDB_SUCCESS))
|
||||
if (unlikely(rc != MDBX_SUCCESS))
|
||||
failure_perror("mdbx_put(insert-b)", rc);
|
||||
|
||||
if (++txn_nops >= config.params.batch_write) {
|
||||
@@ -184,7 +185,7 @@ bool testcase_hill::run() {
|
||||
log_trace("downhill: delete-a (age %" PRIu64 ") %" PRIu64, age_shift,
|
||||
a_serial);
|
||||
rc = mdbx_del(txn_guard.get(), dbi, &a_key->value, &a_data_1->value);
|
||||
if (unlikely(rc != MDB_SUCCESS))
|
||||
if (unlikely(rc != MDBX_SUCCESS))
|
||||
failure_perror("mdbx_del(a)", rc);
|
||||
|
||||
if (++txn_nops >= config.params.batch_write) {
|
||||
@@ -195,7 +196,7 @@ bool testcase_hill::run() {
|
||||
// удаляем вторую запись
|
||||
log_trace("downhill: delete-b %" PRIu64, b_serial);
|
||||
rc = mdbx_del(txn_guard.get(), dbi, &b_key->value, &b_data->value);
|
||||
if (unlikely(rc != MDB_SUCCESS))
|
||||
if (unlikely(rc != MDBX_SUCCESS))
|
||||
failure_perror("mdbx_del(b)", rc);
|
||||
|
||||
if (++txn_nops >= config.params.batch_write) {
|
||||
|
@@ -73,8 +73,8 @@ void __hot maker::pair(serial_t serial, const buffer &key, buffer &value,
|
||||
assert(mapping.mesh <= mapping.width);
|
||||
assert(mapping.rotate <= mapping.width);
|
||||
assert(mapping.offset <= mask(mapping.width));
|
||||
assert(!(key_essentials.flags & (MDB_INTEGERDUP | MDB_REVERSEDUP)));
|
||||
assert(!(value_essentials.flags & (MDB_INTEGERKEY | MDB_REVERSEKEY)));
|
||||
assert(!(key_essentials.flags & (MDBX_INTEGERDUP | MDBX_REVERSEDUP)));
|
||||
assert(!(value_essentials.flags & (MDBX_INTEGERKEY | MDBX_REVERSEKEY)));
|
||||
|
||||
log_trace("keygen-pair: serial %" PRIu64 ", data-age %" PRIu64, serial,
|
||||
value_age);
|
||||
@@ -120,12 +120,13 @@ void __hot maker::pair(serial_t serial, const buffer &key, buffer &value,
|
||||
|
||||
void maker::setup(const config::actor_params_pod &actor,
|
||||
unsigned thread_number) {
|
||||
key_essentials.flags = actor.table_flags & (MDB_INTEGERKEY | MDB_REVERSEKEY);
|
||||
key_essentials.flags =
|
||||
actor.table_flags & (MDBX_INTEGERKEY | MDBX_REVERSEKEY);
|
||||
key_essentials.minlen = actor.keylen_min;
|
||||
key_essentials.maxlen = actor.keylen_max;
|
||||
|
||||
value_essentials.flags =
|
||||
actor.table_flags & (MDB_INTEGERDUP | MDB_REVERSEDUP);
|
||||
actor.table_flags & (MDBX_INTEGERDUP | MDBX_REVERSEDUP);
|
||||
value_essentials.minlen = actor.datalen_min;
|
||||
value_essentials.maxlen = actor.datalen_max;
|
||||
|
||||
@@ -196,14 +197,14 @@ void __hot maker::mk(const serial_t serial, const essentials ¶ms,
|
||||
out.value.iov_base = out.bytes;
|
||||
out.value.iov_len = params.minlen;
|
||||
|
||||
if (params.flags & (MDB_INTEGERKEY | MDB_INTEGERDUP)) {
|
||||
if (params.flags & (MDBX_INTEGERKEY | MDBX_INTEGERDUP)) {
|
||||
assert(params.maxlen == params.minlen);
|
||||
assert(params.minlen == 4 || params.minlen == 8);
|
||||
if (is_byteorder_le() || params.minlen == 8)
|
||||
out.u64 = serial;
|
||||
else
|
||||
out.u32 = (uint32_t)serial;
|
||||
} else if (params.flags & (MDB_REVERSEKEY | MDB_REVERSEDUP)) {
|
||||
} else if (params.flags & (MDBX_REVERSEKEY | MDBX_REVERSEDUP)) {
|
||||
if (out.value.iov_len > 8) {
|
||||
memset(out.bytes, '\0', out.value.iov_len - 8);
|
||||
unaligned::store(out.bytes + out.value.iov_len - 8, htobe64(serial));
|
||||
|
@@ -101,9 +101,9 @@ bool output(const logging::loglevel priority, const char *format, va_list ap) {
|
||||
#ifdef _MSC_VER
|
||||
int rc = _localtime32_s(&tm, (const __time32_t *)&now.utc);
|
||||
#else
|
||||
int rc = localtime_r(&time, &tm) ? MDB_SUCCESS : errno;
|
||||
int rc = localtime_r(&time, &tm) ? MDBX_SUCCESS : errno;
|
||||
#endif
|
||||
if (rc != MDB_SUCCESS)
|
||||
if (rc != MDBX_SUCCESS)
|
||||
failure_perror("localtime_r()", rc);
|
||||
|
||||
last = stdout;
|
||||
|
@@ -37,9 +37,9 @@ void actor_params::set_defaults(void) {
|
||||
#else
|
||||
"test_tmpdb.mdbx";
|
||||
#endif
|
||||
mode_flags = MDB_NOSUBDIR | MDB_WRITEMAP | MDB_MAPASYNC | MDB_NORDAHEAD |
|
||||
MDB_NOMEMINIT | MDBX_COALESCE | MDBX_LIFORECLAIM;
|
||||
table_flags = MDB_DUPSORT;
|
||||
mode_flags = MDBX_NOSUBDIR | MDBX_WRITEMAP | MDBX_MAPASYNC | MDBX_NORDAHEAD |
|
||||
MDBX_NOMEMINIT | MDBX_COALESCE | MDBX_LIFORECLAIM;
|
||||
table_flags = MDBX_DUPSORT;
|
||||
size = 1024 * 1024;
|
||||
|
||||
keygen.seed = 1;
|
||||
|
@@ -20,7 +20,7 @@ static HANDLE hBarrierSemaphore, hBarrierEvent;
|
||||
static int waitstatus2errcode(DWORD result) {
|
||||
switch (result) {
|
||||
case WAIT_OBJECT_0:
|
||||
return MDB_SUCCESS;
|
||||
return MDBX_SUCCESS;
|
||||
case WAIT_FAILED:
|
||||
return GetLastError();
|
||||
case WAIT_ABANDONED:
|
||||
|
46
test/test.cc
46
test/test.cc
@@ -90,7 +90,7 @@ static void mdbx_debug_logger(int type, const char *function, int line,
|
||||
abort();
|
||||
}
|
||||
|
||||
int testcase::oom_callback(MDB_env *env, int pid, mdbx_tid_t tid, uint64_t txn,
|
||||
int testcase::oom_callback(MDBX_env *env, int pid, mdbx_tid_t tid, uint64_t txn,
|
||||
unsigned gap, int retry) {
|
||||
|
||||
testcase *self = (testcase *)mdbx_env_get_userctx(env);
|
||||
@@ -121,32 +121,32 @@ void testcase::db_prepare() {
|
||||
int rc = mdbx_setup_debug(mdbx_dbg_opts, mdbx_debug_logger, MDBX_DBG_DNT);
|
||||
log_info("set mdbx debug-opts: 0x%02x", rc);
|
||||
|
||||
MDB_env *env = nullptr;
|
||||
MDBX_env *env = nullptr;
|
||||
rc = mdbx_env_create(&env);
|
||||
if (unlikely(rc != MDB_SUCCESS))
|
||||
if (unlikely(rc != MDBX_SUCCESS))
|
||||
failure_perror("mdbx_env_create()", rc);
|
||||
|
||||
assert(env != nullptr);
|
||||
db_guard.reset(env);
|
||||
|
||||
rc = mdbx_env_set_userctx(env, this);
|
||||
if (unlikely(rc != MDB_SUCCESS))
|
||||
if (unlikely(rc != MDBX_SUCCESS))
|
||||
failure_perror("mdbx_env_set_userctx()", rc);
|
||||
|
||||
rc = mdbx_env_set_maxreaders(env, config.params.max_readers);
|
||||
if (unlikely(rc != MDB_SUCCESS))
|
||||
if (unlikely(rc != MDBX_SUCCESS))
|
||||
failure_perror("mdbx_env_set_maxreaders()", rc);
|
||||
|
||||
rc = mdbx_env_set_maxdbs(env, config.params.max_tables);
|
||||
if (unlikely(rc != MDB_SUCCESS))
|
||||
if (unlikely(rc != MDBX_SUCCESS))
|
||||
failure_perror("mdbx_env_set_maxdbs()", rc);
|
||||
|
||||
rc = mdbx_env_set_oomfunc(env, testcase::oom_callback);
|
||||
if (unlikely(rc != MDB_SUCCESS))
|
||||
if (unlikely(rc != MDBX_SUCCESS))
|
||||
failure_perror("mdbx_env_set_oomfunc()", rc);
|
||||
|
||||
rc = mdbx_env_set_mapsize(env, (size_t)config.params.size);
|
||||
if (unlikely(rc != MDB_SUCCESS))
|
||||
if (unlikely(rc != MDBX_SUCCESS))
|
||||
failure_perror("mdbx_env_set_mapsize()", rc);
|
||||
|
||||
log_trace("<< db_prepare");
|
||||
@@ -159,7 +159,7 @@ void testcase::db_open() {
|
||||
db_prepare();
|
||||
int rc = mdbx_env_open(db_guard.get(), config.params.pathname_db.c_str(),
|
||||
(unsigned)config.params.mode_flags, 0640);
|
||||
if (unlikely(rc != MDB_SUCCESS))
|
||||
if (unlikely(rc != MDBX_SUCCESS))
|
||||
failure_perror("mdbx_env_open()", rc);
|
||||
|
||||
log_trace("<< db_open");
|
||||
@@ -179,8 +179,8 @@ void testcase::txn_begin(bool readonly) {
|
||||
|
||||
MDBX_txn *txn = nullptr;
|
||||
int rc =
|
||||
mdbx_txn_begin(db_guard.get(), nullptr, readonly ? MDB_RDONLY : 0, &txn);
|
||||
if (unlikely(rc != MDB_SUCCESS))
|
||||
mdbx_txn_begin(db_guard.get(), nullptr, readonly ? MDBX_RDONLY : 0, &txn);
|
||||
if (unlikely(rc != MDBX_SUCCESS))
|
||||
failure_perror("mdbx_txn_begin()", rc);
|
||||
txn_guard.reset(txn);
|
||||
|
||||
@@ -194,11 +194,11 @@ void testcase::txn_end(bool abort) {
|
||||
MDBX_txn *txn = txn_guard.release();
|
||||
if (abort) {
|
||||
int rc = mdbx_txn_abort(txn);
|
||||
if (unlikely(rc != MDB_SUCCESS))
|
||||
if (unlikely(rc != MDBX_SUCCESS))
|
||||
failure_perror("mdbx_txn_abort()", rc);
|
||||
} else {
|
||||
int rc = mdbx_txn_commit(txn);
|
||||
if (unlikely(rc != MDB_SUCCESS))
|
||||
if (unlikely(rc != MDBX_SUCCESS))
|
||||
failure_perror("mdbx_txn_commit()", rc);
|
||||
}
|
||||
|
||||
@@ -303,7 +303,7 @@ void testcase::fetch_canary() {
|
||||
log_trace(">> fetch_canary");
|
||||
|
||||
int rc = mdbx_canary_get(txn_guard.get(), &canary_now);
|
||||
if (unlikely(rc != MDB_SUCCESS))
|
||||
if (unlikely(rc != MDBX_SUCCESS))
|
||||
failure_perror("mdbx_canary_get()", rc);
|
||||
|
||||
if (canary_now.v < last.canary.v)
|
||||
@@ -329,13 +329,13 @@ void testcase::update_canary(uint64_t increment) {
|
||||
canary_now.y += increment;
|
||||
|
||||
int rc = mdbx_canary_put(txn_guard.get(), &canary_now);
|
||||
if (unlikely(rc != MDB_SUCCESS))
|
||||
if (unlikely(rc != MDBX_SUCCESS))
|
||||
failure_perror("mdbx_canary_put()", rc);
|
||||
|
||||
log_trace("<< update_canary: sequence = %" PRIu64, canary_now.y);
|
||||
}
|
||||
|
||||
MDB_dbi testcase::db_table_open(bool create) {
|
||||
MDBX_dbi testcase::db_table_open(bool create) {
|
||||
log_trace(">> testcase::db_table_create");
|
||||
|
||||
char tablename_buf[16];
|
||||
@@ -349,23 +349,23 @@ MDB_dbi testcase::db_table_open(bool create) {
|
||||
}
|
||||
log_verbose("use %s table", tablename ? tablename : "MAINDB");
|
||||
|
||||
MDB_dbi handle = 0;
|
||||
MDBX_dbi handle = 0;
|
||||
int rc = mdbx_dbi_open(txn_guard.get(), tablename,
|
||||
(create ? MDB_CREATE : 0) | config.params.table_flags,
|
||||
(create ? MDBX_CREATE : 0) | config.params.table_flags,
|
||||
&handle);
|
||||
if (unlikely(rc != MDB_SUCCESS))
|
||||
if (unlikely(rc != MDBX_SUCCESS))
|
||||
failure_perror("mdbx_dbi_open()", rc);
|
||||
|
||||
log_trace("<< testcase::db_table_create, handle %u", handle);
|
||||
return handle;
|
||||
}
|
||||
|
||||
void testcase::db_table_drop(MDB_dbi handle) {
|
||||
void testcase::db_table_drop(MDBX_dbi handle) {
|
||||
log_trace(">> testcase::db_table_drop, handle %u", handle);
|
||||
|
||||
if (config.params.drop_table) {
|
||||
int rc = mdbx_drop(txn_guard.get(), handle, true);
|
||||
if (unlikely(rc != MDB_SUCCESS))
|
||||
if (unlikely(rc != MDBX_SUCCESS))
|
||||
failure_perror("mdbx_drop()", rc);
|
||||
log_trace("<< testcase::db_table_drop");
|
||||
} else {
|
||||
@@ -373,11 +373,11 @@ void testcase::db_table_drop(MDB_dbi handle) {
|
||||
}
|
||||
}
|
||||
|
||||
void testcase::db_table_close(MDB_dbi handle) {
|
||||
void testcase::db_table_close(MDBX_dbi handle) {
|
||||
log_trace(">> testcase::db_table_close, handle %u", handle);
|
||||
assert(!txn_guard);
|
||||
int rc = mdbx_dbi_close(db_guard.get(), handle);
|
||||
if (unlikely(rc != MDB_SUCCESS))
|
||||
if (unlikely(rc != MDBX_SUCCESS))
|
||||
failure_perror("mdbx_dbi_close()", rc);
|
||||
log_trace("<< testcase::db_table_close");
|
||||
}
|
||||
|
22
test/test.h
22
test/test.h
@@ -54,8 +54,8 @@ extern bool failfast;
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
struct db_deleter : public std::unary_function<void, MDB_env *> {
|
||||
void operator()(MDB_env *env) const { mdbx_env_close(env); }
|
||||
struct db_deleter : public std::unary_function<void, MDBX_env *> {
|
||||
void operator()(MDBX_env *env) const { mdbx_env_close(env); }
|
||||
};
|
||||
|
||||
struct txn_deleter : public std::unary_function<void, MDBX_txn *> {
|
||||
@@ -66,13 +66,13 @@ struct txn_deleter : public std::unary_function<void, MDBX_txn *> {
|
||||
}
|
||||
};
|
||||
|
||||
struct cursor_deleter : public std::unary_function<void, MDB_cursor *> {
|
||||
void operator()(MDB_cursor *cursor) const { mdbx_cursor_close(cursor); }
|
||||
struct cursor_deleter : public std::unary_function<void, MDBX_cursor *> {
|
||||
void operator()(MDBX_cursor *cursor) const { mdbx_cursor_close(cursor); }
|
||||
};
|
||||
|
||||
typedef std::unique_ptr<MDB_env, db_deleter> scoped_db_guard;
|
||||
typedef std::unique_ptr<MDBX_env, db_deleter> scoped_db_guard;
|
||||
typedef std::unique_ptr<MDBX_txn, txn_deleter> scoped_txn_guard;
|
||||
typedef std::unique_ptr<MDB_cursor, cursor_deleter> scoped_cursor_guard;
|
||||
typedef std::unique_ptr<MDBX_cursor, cursor_deleter> scoped_cursor_guard;
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
@@ -96,7 +96,7 @@ protected:
|
||||
mdbx_canary canary;
|
||||
} last;
|
||||
|
||||
static int oom_callback(MDB_env *env, int pid, mdbx_tid_t tid, uint64_t txn,
|
||||
static int oom_callback(MDBX_env *env, int pid, mdbx_tid_t tid, uint64_t txn,
|
||||
unsigned gap, int retry);
|
||||
|
||||
void db_prepare();
|
||||
@@ -108,9 +108,9 @@ protected:
|
||||
void fetch_canary();
|
||||
void update_canary(uint64_t increment);
|
||||
|
||||
MDB_dbi db_table_open(bool create);
|
||||
void db_table_drop(MDB_dbi handle);
|
||||
void db_table_close(MDB_dbi handle);
|
||||
MDBX_dbi db_table_open(bool create);
|
||||
void db_table_drop(MDBX_dbi handle);
|
||||
void db_table_close(MDBX_dbi handle);
|
||||
|
||||
bool wait4start();
|
||||
void report(size_t nops_done);
|
||||
@@ -128,7 +128,7 @@ protected:
|
||||
}
|
||||
|
||||
bool mode_readonly() const {
|
||||
return (config.params.mode_flags & MDB_RDONLY) ? true : false;
|
||||
return (config.params.mode_flags & MDBX_RDONLY) ? true : false;
|
||||
}
|
||||
|
||||
public:
|
||||
|
@@ -95,7 +95,7 @@
|
||||
<PrecompiledHeader>Use</PrecompiledHeader>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;MDBX_DEBUG=1;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<PrecompiledHeaderFile>test.h</PrecompiledHeaderFile>
|
||||
</ClCompile>
|
||||
@@ -110,7 +110,7 @@
|
||||
<PrecompiledHeader>Use</PrecompiledHeader>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<PreprocessorDefinitions>_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions>_DEBUG;_CONSOLE;MDBX_DEBUG=1;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<PrecompiledHeaderFile>test.h</PrecompiledHeaderFile>
|
||||
</ClCompile>
|
||||
|
Reference in New Issue
Block a user