-
Notifications
You must be signed in to change notification settings - Fork 16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for MDB_VL32 #12
Comments
Hi, very sorry I missed this issue, I had some difficult circumstances and wasn't following up on github issues. Yes, I think this is a good idea to support this, and your proposed change doesn't sound too intrusive. |
Thanks. I'll make a pull request. |
I recognized MDB_VL32 feature has not been officially released yet. We can, maybe, employ some metaprogramming technique to detect if the type is defined or not, but using a preprocessor is simple and enough, isn't it? namespace lmdb {
using mode = mdb_mode_t;
#ifdef MDB_SIZE_MAX
using size_t = mdb_size_t;
#else
using size_t = std::size_t;
#endif
} |
Yes I think that seems reasonable, ideally a comment explaining when we'd expect BTW: Will you be testing this with the unreleased VL32 feature? Are you using it for anything now, or planning to? |
I do use VL32 for enable copying database files created on Win64 PC to 32-bit ARM device. I can participate in testing modifications required, because I do modification of hoytech/lmdbxx myself anyway. |
If
MDB_VL32
is defined, 32bit lmdb lib can handle a db made by 64bit lmdb lib.In this case,
mdb_size_t
is not the same asstd::size_t
.One possible modification to handle the situation, add lmdb::size_t like as
then replace
std::size_t
withlmdb::size_t
in places related withmdb_env_set_mapsize()
,mdb_txn_id()
andmdb_cursor_count()
.This situation may be not so often, however, I think this modification should not be harmful for other situations, mdb_size_t = size_t.
If this modification is acceptable for you, I will make a pull request in that way.
What do you think?
The text was updated successfully, but these errors were encountered: