Skip to content

Commit

Permalink
no -O2 hardcode (#83)
Browse files Browse the repository at this point in the history
  • Loading branch information
AskAlexSharov authored Sep 29, 2022
1 parent 81c9589 commit 8d7e1e2
Showing 1 changed file with 6 additions and 10 deletions.
16 changes: 6 additions & 10 deletions mdbx/mdbx.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@ reference.
http://www.lmdb.tech/doc/starting.html
http://www.lmdb.tech/doc/modules.html
Environment
# Environment
An LMDB environment holds named databases (key-value stores). An environment
is represented as one file on the filesystem (though often a corresponding lock
Expand All @@ -25,8 +24,7 @@ Note that the package lmdb forces all Env objects to be opened with the NoTLS
(in the author's opinion). However, even for environments opened with this
flag there are caveats regarding how transactions are used (see Caveats below).
Databases
# Databases
A database in an LMDB environment is an ordered key-value store that holds
arbitrary binary data. Typically the keys are unique but duplicate keys may be
Expand All @@ -43,8 +41,7 @@ closed but it is not required. Typically, applications acquire handles for all
their databases immediately after opening an environment and retain them for
the lifetime of the process.
Transactions
# Transactions
View (readonly) transactions in LMDB operate on a snapshot of the database at
the time the transaction began. The number of simultaneously active view
Expand Down Expand Up @@ -108,8 +105,7 @@ uses a finalizer to abort unreachable Txn objects. But of course, applications
must still be careful not to leak unterminated Txn objects in a way such that
they fail get garbage collected.
Caveats
# Caveats
Write transactions (those created without the Readonly flag) must be created in
a goroutine that has been locked to its thread by calling the function
Expand All @@ -131,8 +127,8 @@ details about dealing with such situations.
package mdbx

/*
#cgo !windows CFLAGS: -O2 -g -DMDBX_BUILD_FLAGS='' -DNDEBUG=1 -std=gnu11 -fvisibility=hidden -ffast-math -fPIC -pthread -Wno-error=attributes -W -Wall -Werror -Wextra -Wpedantic -Wno-deprecated-declarations -Wno-format -Wno-implicit-fallthrough -Wno-unused-parameter -Wno-format-extra-args -Wno-missing-field-initializers
#cgo windows CFLAGS: -O2 -g -DMDBX_BUILD_FLAGS='' -DNDEBUG=1 -std=gnu11 -fvisibility=hidden -ffast-math -fexceptions -fno-common -W -Wno-deprecated-declarations -Wno-bad-function-cast -Wno-cast-function-type -Wall -Wno-format -Wno-implicit-fallthrough -Wno-unused-parameter -Wno-format-extra-args -Wno-missing-field-initializers
#cgo !windows CFLAGS: -DMDBX_BUILD_FLAGS='' -DNDEBUG=1 -std=gnu11 -fvisibility=hidden -ffast-math -fPIC -pthread -Wno-error=attributes -W -Wall -Werror -Wextra -Wpedantic -Wno-deprecated-declarations -Wno-format -Wno-implicit-fallthrough -Wno-unused-parameter -Wno-format-extra-args -Wno-missing-field-initializers
#cgo windows CFLAGS: -DMDBX_BUILD_FLAGS='' -DNDEBUG=1 -std=gnu11 -fvisibility=hidden -ffast-math -fexceptions -fno-common -W -Wno-deprecated-declarations -Wno-bad-function-cast -Wno-cast-function-type -Wall -Wno-format -Wno-implicit-fallthrough -Wno-unused-parameter -Wno-format-extra-args -Wno-missing-field-initializers
#cgo windows LDFLAGS: -lntdll
#cgo linux LDFLAGS: -lrt
Expand Down

0 comments on commit 8d7e1e2

Please sign in to comment.