aboutsummaryrefslogtreecommitdiff
path: root/main.c
diff options
context:
space:
mode:
authorJan Mercl <0xjnml@gmail.com>2017-06-13 15:18:34 +0200
committerJan Mercl <0xjnml@gmail.com>2017-06-13 15:18:34 +0200
commit11216f730451a292847505d464294ed7cf2c05c4 (patch)
tree6a4a698a908984439a496b5df452f0e36b4a82e5 /main.c
parentec1aabd88adb1660d33f8ca47a56633773de98f6 (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 'main.c')
-rw-r--r--main.c27
1 files changed, 2 insertions, 25 deletions
diff --git a/main.c b/main.c
index 4fe3ac4..d54aa13 100644
--- a/main.c
+++ b/main.c
@@ -1,36 +1,13 @@
// Copyright 2017 The Sqlite Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
-// SQLite Is Public Domain
// +build ignore
-#define minAlloc (2<<5)
-
#include <sqlite3.h>
-#include <stdlib.h>
int main(int argc, char **argv)
{
- init(-1);
-}
-
-int init(int heapSize)
-{
- void *heap = malloc(heapSize);
- if (heap == 0) {
- return 1;
- }
-
- int rc = sqlite3_config(SQLITE_CONFIG_HEAP, heap, heapSize, minAlloc);
- if (rc) {
- return 2;
- }
-
- rc = sqlite3_threadsafe();
- if (!rc) {
- return 3;
- }
-
- return 0;
+ // Prevent the linker from optimizing out everything.
+ int (*f) (int, ...) = sqlite3_config;
}