diff options
author | Jan Mercl <0xjnml@gmail.com> | 2017-06-13 15:18:34 +0200 |
---|---|---|
committer | Jan Mercl <0xjnml@gmail.com> | 2017-06-13 15:18:34 +0200 |
commit | 11216f730451a292847505d464294ed7cf2c05c4 (patch) | |
tree | 6a4a698a908984439a496b5df452f0e36b4a82e5 /generator.go | |
parent | ec1aabd88adb1660d33f8ca47a56633773de98f6 (diff) |
Do not use fixed heap on Linux. Updates #12.
modified: all_test.go
modified: generator.go
modified: internal/bin/bin_linux_386.go
modified: internal/bin/bin_linux_amd64.go
modified: main.c
modified: sqlite.go
modified: sqlite_go18.go
Diffstat (limited to 'generator.go')
-rw-r--r-- | generator.go | 23 |
1 files changed, 4 insertions, 19 deletions
diff --git a/generator.go b/generator.go index 8529cf3..2a7c450 100644 --- a/generator.go +++ b/generator.go @@ -61,33 +61,16 @@ import ( "unsafe" "github.com/cznic/crt" - "github.com/edsrzf/mmap-go" - ) -const minAlloc = 2<<5 +var inf = math.Inf(1) -var ( - inf = math.Inf(1) -) func ftrace(s string, args ...interface{}) { _, fn, fl, _ := runtime.Caller(1) fmt.Fprintf(os.Stderr, "# %%s:%%d: %%v\n", path.Base(fn), fl, fmt.Sprintf(s, args...)) os.Stderr.Sync() } - -func Init(heapSize, heapReserve int) int { - heap, err := mmap.MapRegion(nil, heapSize+heapReserve, mmap.RDWR, mmap.ANON, 0) - if err != nil { - panic(err) - } - - tls := crt.NewTLS() - crt.RegisterHeap(unsafe.Pointer(&heap[0]), int64(heapSize+heapReserve)) - crt.X__register_stdfiles(tls, Xstdin, Xstdout, Xstderr) - return int(Xinit(tls, int32(heapSize))) -} ` ) @@ -265,11 +248,13 @@ func main() { asta, src := build( ` + #define HAVE_MALLOC_H 1 + #define HAVE_MALLOC_USABLE_SIZE 1 #define HAVE_USLEEP 1 #define SQLITE_DEBUG 1 #define SQLITE_ENABLE_API_ARMOR 1 - #define SQLITE_ENABLE_MEMSYS5 1 #define SQLITE_USE_URI 1 + #define SQLITE_WITHOUT_MSIZE 1 `, [][]string{ {"main.c"}, |