diff options
author | Jan Mercl <0xjnml@gmail.com> | 2017-06-25 21:21:16 +0200 |
---|---|---|
committer | Jan Mercl <0xjnml@gmail.com> | 2017-06-25 21:21:16 +0200 |
commit | 1bfd9f3914275716a35c24effe0abc4af1e42135 (patch) | |
tree | b7d5fe4e6114b1f0f5e4d5b82a52730765f60a7a /main.c | |
parent | 5c0a7b2d9986629db710a3740a95f368e0c2a671 (diff) | |
parent | 48a57de665db990e7fabaf792f7567bb2b622f5a (diff) |
Merge branch 'issue12'. Fixes #12.
Diffstat (limited to 'main.c')
-rw-r--r-- | main.c | 27 |
1 files changed, 2 insertions, 25 deletions
@@ -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; } |