mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-06-27 23:08:31 +00:00
Get SQLite to build
* changed headers * removed redundant declarations * ran clang-format * added sqlite3.mk
This commit is contained in:
parent
644f290035
commit
919b6fec10
156 changed files with 2847 additions and 6772 deletions
11
third_party/sqlite3/mem5.c
vendored
11
third_party/sqlite3/mem5.c
vendored
|
@ -10,12 +10,12 @@
|
|||
**
|
||||
*************************************************************************
|
||||
** This file contains the C functions that implement a memory
|
||||
** allocation subsystem for use by SQLite.
|
||||
** allocation subsystem for use by SQLite.
|
||||
**
|
||||
** This version of the memory allocation subsystem omits all
|
||||
** use of malloc(). The application gives SQLite a block of memory
|
||||
** before calling sqlite3_initialize() from which allocations
|
||||
** are made and returned by the xMalloc() and xRealloc()
|
||||
** are made and returned by the xMalloc() and xRealloc()
|
||||
** implementations. Once sqlite3_initialize() has been called,
|
||||
** the amount of memory available to SQLite is fixed and cannot
|
||||
** be changed.
|
||||
|
@ -35,12 +35,12 @@
|
|||
** This algorithm is described in: J. M. Robson. "Bounds for Some Functions
|
||||
** Concerning Dynamic Storage Allocation". Journal of the Association for
|
||||
** Computing Machinery, Volume 21, Number 8, July 1974, pages 491-499.
|
||||
**
|
||||
**
|
||||
** Let n be the size of the largest allocation divided by the minimum
|
||||
** allocation size (after rounding all sizes up to a power of 2.) Let M
|
||||
** be the maximum amount of memory ever outstanding at one time. Let
|
||||
** N be the total amount of memory available for allocation. Robson
|
||||
** proved that this memory allocator will never breakdown due to
|
||||
** proved that this memory allocator will never breakdown due to
|
||||
** fragmentation as long as the following constraint holds:
|
||||
**
|
||||
** N >= M*(1 + log2(n)/2) - n + 1
|
||||
|
@ -48,7 +48,8 @@
|
|||
** The sqlite3_status() logic tracks the maximum values of n and M so
|
||||
** that an application can, at any time, verify this constraint.
|
||||
*/
|
||||
#include "sqliteInt.h"
|
||||
#include "third_party/sqlite3/sqliteInt.h"
|
||||
/* clang-format off */
|
||||
|
||||
/*
|
||||
** This version of the memory allocator is used only when
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue