From 11216f730451a292847505d464294ed7cf2c05c4 Mon Sep 17 00:00:00 2001 From: Jan Mercl <0xjnml@gmail.com> Date: Tue, 13 Jun 2017 15:18:34 +0200 Subject: 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 --- main.c | 27 ++------------------------- 1 file changed, 2 insertions(+), 25 deletions(-) (limited to 'main.c') 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 -#include 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; } -- cgit v1.2.3-70-g09d2