Skip to content

Commit

Permalink
Add bindings for mdbx_env_set_syncbytes and mdbx_env_get_syncbytes (
Browse files Browse the repository at this point in the history
#167)

add bindings for mdbx_env_set_syncbytes

Co-authored-by: antonis19 <antonis19@users.noreply.github.com>
  • Loading branch information
antonis19 and antonis19 committed Feb 25, 2025
1 parent e4dd019 commit fa62db2
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions mdbx/env.go
Original file line number Diff line number Diff line change
Expand Up @@ -469,6 +469,19 @@ func (env *Env) GetSyncPeriod() (time.Duration, error) {
return Duration16dot16(res).ToDuration(), operrno("mdbx_env_get_syncperiod", ret)
}

func (env *Env) SetSyncBytes(threshold uint) error {
ret := C.mdbx_env_set_syncbytes(env._env, C.size_t(threshold))
return operrno("mdbx_env_set_syncbytes", ret)

}

func (env *Env) GetSyncBytes() (uint, error) {
var res C.size_t
ret := C.mdbx_env_get_syncbytes(env._env, &res)
return uint(res), operrno("mdbx_env_get_syncbytes", ret)

}

func (env *Env) SetGeometry(sizeLower int, sizeNow int, sizeUpper int, growthStep int, shrinkThreshold int, pageSize int) error {
ret := C.mdbx_env_set_geometry(env._env,
C.intptr_t(sizeLower),
Expand Down

0 comments on commit fa62db2

Please sign in to comment.