Skip to content
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

Widen argument for setting lmdb map size. #37

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions src/env.jl
Original file line number Diff line number Diff line change
Expand Up @@ -106,15 +106,23 @@ unset!(env::Environment, flag::EnvironmentFlags) = unset!(env, Cuint(flag))
function setindex!(env::Environment, val::Cuint, option::Symbol)
if option == :Readers
mdb_env_set_maxreaders(env.handle, val)
elseif option == :MapSize
mdb_env_set_mapsize(env.handle, val)
elseif option == :DBs
mdb_env_set_maxdbs(env.handle, val)
else
warn("Cannot set $(string(option)) value")
Cint(0)
end
end

function setindex!(env::Environment, val::Csize_t, option::Symbol)
if option == :MapSize
println("Setting map size to: ", val)
mdb_env_set_mapsize(env.handle, val)
else
warn("Cannot set $(string(option)) value")
Cint(0)
end
end
setindex!(env::Environment, val::Int, option::Symbol) = setindex!(env, Cuint(val), option)

"""Get environment flags and parameters
Expand Down