From 05b533496a8384343734af2700e5818a30ff91eb Mon Sep 17 00:00:00 2001 From: Jan Mercl <0xjnml@gmail.com> Date: Tue, 6 Jun 2017 14:55:48 +0200 Subject: 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 --- sqlite.go | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) (limited to 'sqlite.go') diff --git a/sqlite.go b/sqlite.go index 70a4599..9dbb5ad 100644 --- a/sqlite.go +++ b/sqlite.go @@ -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 { -- cgit v1.2.3-70-g09d2