Commit 05b53349 authored by cznic's avatar cznic

Use usleep.

	modified:   all_linux_test.go
	modified:   generator.go
	modified:   internal/bin/bin_linux_386.go
	modified:   internal/bin/bin_linux_amd64.go
	modified:   sqlite.go
parent 8c183b52
......@@ -58,13 +58,7 @@ func init() {
// ============================================================================
var (
// Add "-tags virtual.profile" to the command.
profileAll = flag.Bool("profile", false, "")
profileFunctions = flag.Bool("profile_functions", false, "")
profileInstructions = flag.Bool("profile_instructions", false, "")
profileLines = flag.Bool("profile_lines", false, "")
profileRate = flag.Int("profile_rate", 1000, "")
recsPerSec = flag.Bool("recs_per_sec_as_mbps", false, "Show records per second as MB/s.")
recsPerSec = flag.Bool("recs_per_sec_as_mbps", false, "Show records per second as MB/s.")
)
func tempDB(t testing.TB) (string, *sql.DB) {
......
......@@ -264,6 +264,7 @@ func main() {
asta, src := build(
`
#define HAVE_USLEEP 1
#define SQLITE_DEBUG 1
#define SQLITE_ENABLE_API_ARMOR 1
#define SQLITE_ENABLE_MEMSYS5 1
......
This diff is collapsed.
This diff is collapsed.
......@@ -5,6 +5,7 @@
package sqlite
import (
"bytes"
"database/sql"
"database/sql/driver"
"fmt"
......@@ -17,10 +18,7 @@ import (
"unsafe"
"github.com/cznic/crt"
"github.com/cznic/internal/buffer"
"github.com/cznic/mathutil"
"github.com/cznic/sqlite/internal/bin"
"github.com/cznic/xc"
"golang.org/x/net/context"
)
......@@ -37,13 +35,9 @@ var (
const (
driverName = "sqlite"
ptrSize = mathutil.UintPtrBits / 8
heapReserve = 1 << 20
heapSize = 32 << 20
)
var (
dict = xc.Dict
ptrSize = 1 << (^uintptr(0)>>32&1 + ^uintptr(0)>>16&1 + ^uintptr(0)>>8&1 + 3) / 8
)
func init() {
......@@ -52,12 +46,11 @@ func init() {
}
func tracer(rx interface{}, format string, args ...interface{}) {
var b buffer.Bytes
var b bytes.Buffer
_, file, line, _ := runtime.Caller(1)
fmt.Fprintf(&b, "%v:%v: (%[3]T)(%[3]p).", file, line, rx)
fmt.Fprintf(&b, format, args...)
fmt.Fprintf(os.Stderr, "%s\n", b.Bytes())
b.Close()
}
type result struct {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment