mirror of
https://github.com/isar/libmdbx.git
synced 2025-01-04 17:44:13 +08:00
mdbx: add explicit memset()
for debugging.
This commit is contained in:
parent
d522069080
commit
fef90d2a3c
@ -7281,6 +7281,10 @@ static int mdbx_cursor_shadow(MDBX_txn *parent, MDBX_txn *nested) {
|
|||||||
bk = mdbx_malloc(size);
|
bk = mdbx_malloc(size);
|
||||||
if (unlikely(!bk))
|
if (unlikely(!bk))
|
||||||
return MDBX_ENOMEM;
|
return MDBX_ENOMEM;
|
||||||
|
#if MDBX_DEBUG
|
||||||
|
memset(bk, 0xCD, size);
|
||||||
|
VALGRIND_MAKE_MEM_UNDEFINED(bk, size);
|
||||||
|
#endif /* MDBX_DEBUG */
|
||||||
*bk = *mc;
|
*bk = *mc;
|
||||||
mc->mc_backup = bk;
|
mc->mc_backup = bk;
|
||||||
/* Kill pointers into src to reduce abuse: The
|
/* Kill pointers into src to reduce abuse: The
|
||||||
@ -8137,6 +8141,10 @@ int mdbx_txn_begin_ex(MDBX_env *env, MDBX_txn *parent, MDBX_txn_flags_t flags,
|
|||||||
mdbx_debug("calloc: %s", "failed");
|
mdbx_debug("calloc: %s", "failed");
|
||||||
return MDBX_ENOMEM;
|
return MDBX_ENOMEM;
|
||||||
}
|
}
|
||||||
|
#if MDBX_DEBUG
|
||||||
|
memset(txn, 0xCD, size);
|
||||||
|
VALGRIND_MAKE_MEM_UNDEFINED(txn, size);
|
||||||
|
#endif /* MDBX_DEBUG */
|
||||||
memset(txn, 0, tsize);
|
memset(txn, 0, tsize);
|
||||||
txn->mt_dbxs = env->me_dbxs; /* static */
|
txn->mt_dbxs = env->me_dbxs; /* static */
|
||||||
txn->mt_dbs = (MDBX_db *)((char *)txn + tsize);
|
txn->mt_dbs = (MDBX_db *)((char *)txn + tsize);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user