aboutsummaryrefslogtreecommitdiff
path: root/main.c
diff options
context:
space:
mode:
Diffstat (limited to 'main.c')
-rw-r--r--main.c44
1 files changed, 9 insertions, 35 deletions
diff --git a/main.c b/main.c
index 50d19fd..4fe3ac4 100644
--- a/main.c
+++ b/main.c
@@ -1,30 +1,9 @@
-// +build ignore
-
+// 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
-//
-// All of the code and documentation in SQLite has been dedicated to the public
-// domain by the authors. All code authors, and representatives of the
-// companies they work for, have signed affidavits dedicating their
-// contributions to the public domain and originals of those signed affidavits
-// are stored in a firesafe at the main offices of Hwaci. Anyone is free to
-// copy, modify, publish, use, compile, sell, or distribute the original SQLite
-// code, either in source code form or as a compiled binary, for any purpose,
-// commercial or non-commercial, and by any means.
-//
-// The previous paragraph applies to the deliverable code and documentation in
-// SQLite - those parts of the SQLite library that you actually bundle and ship
-// with a larger application. Some scripts used as part of the build process
-// (for example the "configure" scripts generated by autoconf) might fall under
-// other open-source licenses. Nothing from these build scripts ever reaches
-// the final deliverable SQLite library, however, and so the licenses
-// associated with those scripts should not be a factor in assessing your
-// rights to copy and use the SQLite library.
-//
-// All of the deliverable code in SQLite has been written from scratch. No code
-// has been taken from other projects or from the open internet. Every line of
-// code can be traced back to its original author, and all of those authors
-// have public domain dedications on file. So the SQLite code base is clean and
-// is uncontaminated with licensed code from other projects.
+
+// +build ignore
#define minAlloc (2<<5)
@@ -33,16 +12,11 @@
int main(int argc, char **argv)
{
- if (argc != 2) {
- return 1;
- }
-
- int heapSize = 0;
- char *p = argv[1];
- for (; *p; p++) {
- heapSize = 10 * heapSize + *p - '0';
- }
+ init(-1);
+}
+int init(int heapSize)
+{
void *heap = malloc(heapSize);
if (heap == 0) {
return 1;